fork download
  1. ll check(string s, ll val) {
  2. ll rem = 0;
  3. for(int i = 0; i < s.size(); i++) {
  4. rem = rem * 10 + (s[i] - '0');
  5. rem %= val;
  6. }
  7. return rem;
  8. }
  9. void solve()
  10. {
  11. ll n;
  12. cin >> n;
  13. string s = "2";
  14. for(int i = 2; i <= n; i++) {
  15. ll val = (1LL<<i);
  16. val = check(s, val);
  17. if(val == 0)
  18. s = "2" + s;
  19. else
  20. s = "1" + s;
  21. }
  22. cout << s << '\n';
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘ll’ does not name a type
 ll check(string s, ll val) {
 ^~
prog.cpp: In function ‘void solve()’:
prog.cpp:11:5: error: ‘ll’ was not declared in this scope
     ll n;
     ^~
prog.cpp:12:5: error: ‘cin’ was not declared in this scope
     cin >> n;
     ^~~
prog.cpp:12:12: error: ‘n’ was not declared in this scope
     cin >> n;
            ^
prog.cpp:13:5: error: ‘string’ was not declared in this scope
     string s = "2";
     ^~~~~~
prog.cpp:13:5: note: suggested alternative: ‘struct’
     string s = "2";
     ^~~~~~
     struct
prog.cpp:15:11: error: expected ‘;’ before ‘val’
         ll val = (1LL<<i);
           ^~~~
           ;
prog.cpp:16:9: error: ‘val’ was not declared in this scope
         val = check(s, val);
         ^~~
prog.cpp:16:21: error: ‘s’ was not declared in this scope
         val = check(s, val);
                     ^
prog.cpp:16:15: error: ‘check’ was not declared in this scope
         val = check(s, val);
               ^~~~~
prog.cpp:22:5: error: ‘cout’ was not declared in this scope
     cout << s << '\n';
     ^~~~
prog.cpp:22:13: error: ‘s’ was not declared in this scope
     cout << s << '\n';
             ^
stdout
Standard output is empty