Created
May 12, 2016 03:37
-
-
Save cthbst/6fa5d9cd92ad9248b2209383408c69b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************************************************/ | |
/* Problem: d881 "作業苦多" from CSDC */ | |
/* Language: CPP (334 Bytes) */ | |
/* Result: AC(4ms, 364KB) judge by this@ZeroJudge */ | |
/* Author: cthbst at 2012-02-05 20:04:16 */ | |
/**********************************************************************************/ | |
#include<iostream> | |
using namespace std; | |
int main (int argc,char*argv[]) | |
{ | |
int in0 ; | |
while (cin >>in0 ){ | |
int sum =2 ,ru =1 ; | |
for (int i=1 ;i<50;i++){ | |
sum += ru, ru = 1+(2+i*in0)*(i+1)/2; | |
} | |
cout <<sum <<endl ; | |
} | |
return 0 ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment