Jump! Jump!

  • Jump(http://www.algospot.com/judge/problem/read/JUMP)
  • 점화식. 3step까지 개수를 한번 체크해봐요.

//
//  main.cpp
//  codersHigh2013
//
//  Created by Jereneal Kim on 13. 7. 30..
//  Copyright (c) 2013년 Jereneal Kim. All rights reserved.
//

#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
	long long int sum;
	int T,n;
	scanf("%d",&T);
	for(int iter=0;iter<T;iter++){
		scanf("%d",&n);
		n++;
		sum = ((n-1)*n)/2 +1;
		sum*=sum;
		sum%=20130728;
		printf("%lld\n",sum);
	}
    return 0;
}
Retrieved from http://wiki.zeropage.org/wiki.php/JumpJump/김태진
last modified 2021-02-07 05:23:35