benyeh

PE48

Mar 15th, 2013
554
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×