fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. map<int,bool> dp;
  4. int n;
  5. bool state(ll x) {
  6. if(x >= n) return false;
  7. if(dp.count(x)) return dp[x];
  8. for(int i = 2; i < 10; i++) if(!state(x * i)) return dp[x] = true;
  9. return dp[x] = false;
  10. }
  11. int main() {
  12. int t;
  13. while(scanf("%d", &n) != EOF) {
  14. dp.clear();
  15. if(state(1)) cout << "Stan wins.\n";
  16. else cout << "Ollie wins.\n";
  17. }
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:12: error: 'll' was not declared in this scope
 bool state(ll x) {
            ^
prog.cpp:5:18: error: expected ',' or ';' before '{' token
 bool state(ll x) {
                  ^
prog.cpp: In function 'int main()':
prog.cpp:15:13: error: 'state' cannot be used as a function
   if(state(1)) cout << "Stan wins.\n";
             ^
stdout
Standard output is empty