U E D R , A S I H C RSS

How Many Pieces Of Land?/하기웅

소감

- 보창이의 설명을 들었던 기억 때문에 쉽게 해결한 것 같다.
- 런타임 에러를 잡는데 생각보다 시간이 걸렸다.

소스

~cpp
#include <iostream>
#include "BigInteger.h"
using BigMath::BigInteger;

BigInteger input;
int testcase;

BigInteger Piece_of_Land(BigInteger n)
{ 
	if(n.isZero())
		return 1;
	return (n.Power(4)-6*(n.Power(3))+23*n*n-18*n+24)/24;
}

int main()
{
	cin >> testcase;
	while(testcase--)
	{
		cin >> input;
		cout << Piece_of_Land(input) << endl;
	}
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:25
Processing time 0.0079 sec