fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. ll i,j;
  5. ll va = 1;
  6. ll sum = 0;
  7. ll prime[1000] = {0};
  8. for(i = 2;i <= 500;i++) {
  9. if(prime[i] == 0)
  10. for(j = 2*i;j <= 500;j += i)
  11. prime[j] = 1;
  12. }
  13. ll val[600] = {0};
  14. val[1] = 0;
  15. val[2] = 1;
  16. ll co = 0;
  17. for(i = 3;i <= 500;i++) {
  18. if(prime[i] == 0) {
  19. co++;
  20. }
  21. ll t1 = modPow(2, co);
  22. val[i] = t1 + val[i - 1];
  23. val[i] %= MOD;
  24. // cout << i << " " << val[i] << "\n";
  25. }
  26. ll n;
  27. S(n);
  28. cout << val[n] << "\n";
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:4:9: error: ‘ll’ was not declared in this scope
         ll i,j;
         ^~
prog.cpp:5:11: error: expected ‘;’ before ‘va’
         ll va = 1;
           ^~~
           ;
prog.cpp:6:11: error: expected ‘;’ before ‘sum’
         ll sum = 0;
           ^~~~
           ;
prog.cpp:7:11: error: expected ‘;’ before ‘prime’
         ll prime[1000] = {0};
           ^~~~~~
           ;
prog.cpp:8:13: error: ‘i’ was not declared in this scope
         for(i = 2;i <= 500;i++) {
             ^
prog.cpp:9:16: error: ‘prime’ was not declared in this scope
             if(prime[i] == 0)
                ^~~~~
prog.cpp:9:16: note: suggested alternative: ‘stime’
             if(prime[i] == 0)
                ^~~~~
                stime
prog.cpp:10:21: error: ‘j’ was not declared in this scope
                 for(j = 2*i;j <= 500;j += i)
                     ^
prog.cpp:13:11: error: expected ‘;’ before ‘val’
         ll val[600] = {0};
           ^~~~
           ;
prog.cpp:14:9: error: ‘val’ was not declared in this scope
         val[1] = 0;
         ^~~
prog.cpp:16:11: error: expected ‘;’ before ‘co’
         ll co = 0;
           ^~~
           ;
prog.cpp:17:13: error: ‘i’ was not declared in this scope
         for(i = 3;i <= 500;i++) {
             ^
prog.cpp:18:16: error: ‘prime’ was not declared in this scope
             if(prime[i] == 0) {
                ^~~~~
prog.cpp:18:16: note: suggested alternative: ‘stime’
             if(prime[i] == 0) {
                ^~~~~
                stime
prog.cpp:19:17: error: ‘co’ was not declared in this scope
                 co++;
                 ^~
prog.cpp:21:15: error: expected ‘;’ before ‘t1’
             ll t1 = modPow(2, co);
               ^~~
               ;
prog.cpp:22:22: error: ‘t1’ was not declared in this scope
             val[i] = t1 + val[i - 1];
                      ^~
prog.cpp:22:22: note: suggested alternative: ‘tm’
             val[i] = t1 + val[i - 1];
                      ^~
                      tm
prog.cpp:23:23: error: ‘MOD’ was not declared in this scope
             val[i] %= MOD;
                       ^~~
prog.cpp:26:11: error: expected ‘;’ before ‘n’
         ll n;
           ^~
           ;
prog.cpp:27:11: error: ‘n’ was not declared in this scope
         S(n);
           ^
prog.cpp:27:9: error: ‘S’ was not declared in this scope
         S(n);
         ^
stdout
Standard output is empty