benyeh

PE48

Mar 15th, 2013
565
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     unsigned long long M = 10000000000ULL;
  7.     int pow;
  8.     unsigned long long res = 0ULL, temp;
  9.     for(int i = 1; i <= 1000; i++)
  10.     {
  11.         pow = 1;
  12.         temp = 1;
  13.         while(pow <= i)
  14.         {
  15.             temp = (temp*i) % M;
  16.             pow++;
  17.         }
  18.         res = (res + temp) % M;
  19.     }
  20.     cout << res << endl;
  21.     return 0;
  22. }
RAW Paste Data