SHARE
TWEET

PE48

benyeh Mar 15th, 2013 521 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top