|
|
back to boardWA 13! PLS HELP! Posted by bani4ka 30 Aug 2008 20:03 #include <iostream> using namespace std; int main() { int n; cin >> n; //if(n==1) { cout << 0 << endl; return 0; } unsigned long long p,s=0; for(int i=2;i<=n;i++) { p=1; for(int j=n;j>=n-i+1;j--) p*=j; s+=p; cout << p << " "; } cout << endl; cout << s << endl; //system("Pause"); return 0; } Edited by author 30.08.2008 20:06 Edited by author 30.08.2008 20:08 Re: WA 13! PLS HELP! test 13 is n=21 Re: WA 13! PLS HELP! test 13 is 21 the correct answer is 4131306270 Re: WA 13! PLS HELP! Calculate it yourself Re: WA 13! PLS HELP! N = 21 ANS = 138879579704209680000 =) |
|
|