Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

HowManyPiecesOfLand?/하기웅

From ZeroWiki

소감

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

소스

#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;
}