fork download
  1. #include <bits/stdc++.h>
  2. #define pb push_back
  3. #define mp make_pair
  4. #define ff first
  5. #define ss second
  6. #define sz size()
  7. #define all(a) a.begin(),a.end()
  8. #define SL(n) scanf("%lld",&n)
  9. #define PL(n) printf("%lld",n)
  10. #define fill(a, x) memset(a,x,sizeof(a));
  11. #define mod 1000000007
  12.  
  13. using namespace std;
  14. typedef long long LL;
  15. typedef vector <LL> VL;
  16. typedef map <LL, LL> ML;
  17. typedef pair<LL, LL> PL;
  18. typedef vector <pair <LL, LL> > VPL;
  19.  
  20. class Powerit{
  21. public:
  22. LL Power(LL base, LL expo, LL M){
  23. LL Ans = 1;
  24. while(expo > 0){
  25. if(expo%2 == 1){
  26. Ans = (Ans*base)%M;
  27. }
  28. expo >>= 1;
  29. base = (base*base)%M;
  30. }
  31. return Ans%M;
  32. }
  33. LL Cal(LL n, LL K, LL m){
  34. LL M = ((LL)n * (LL)m);
  35. LL Temp = Power(2, K, M-1);
  36. LL Ans = Power(n, Temp, M);
  37. Ans = (LL)Ans/n;
  38. return (LL)Ans;
  39. }
  40. int calc(LL N, LL K, LL M){
  41. LL Ans = 0;
  42. for(LL n=1;n<=N;++n){
  43. Ans += Cal(n, K, M);
  44. Ans %= M;
  45. }
  46. return (int)(Ans%M);
  47. }
  48. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function `_start':
/home/aurel32/tmp/glibc/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty