Submission #1034223

#TimeUsernameProblemLanguageResultExecution timeMemory
1034223vjudge1cmp (balkan11_cmp)C++17
Compilation error
0 ms0 KiB
void remember(int a){ int cur = 21, rr = 31; for(int i = 0; i < 11; i+=2){ if((1<<i)&a && (1<<(i+1))&a){ bit_set(cur); } else if((1<<i)&a){ bit_set(i); } else if((1<<(i+1))&a){ bit_set(i+1); } else{ bit_set(rr); } cur++; rr++; } } int compare(int a){ int cur = 27, rr = 37; for(int i = 11; i >= 1; i-=2){ cur--; rr--; if(a&(1<<i) && a&(1<<(i-1))){ int f = bit_get(cur); if(f) continue; return 1; } if(a&(1<<i)){ int x = bit_get(i); if(x) continue; int y = bit_get(rr); if(y == 1) return 1; int z = bit_get(cur); if(z) return -1; else return 1; } if(a&(1<<(i-1))){ int x = bit_get(i-1); if(x) continue; int y = bit_get(rr); if(y == 1) return 1; return -1; } int x = bit_get(rr); if(x == 0) return -1; continue; } return 0; }

Compilation message (stderr)

cmp.cpp: In function 'void remember(int)':
cmp.cpp:7:13: error: 'bit_set' was not declared in this scope
    7 |             bit_set(cur);
      |             ^~~~~~~
cmp.cpp:10:13: error: 'bit_set' was not declared in this scope
   10 |             bit_set(i);
      |             ^~~~~~~
cmp.cpp:13:13: error: 'bit_set' was not declared in this scope
   13 |             bit_set(i+1);
      |             ^~~~~~~
cmp.cpp:16:13: error: 'bit_set' was not declared in this scope
   16 |             bit_set(rr);
      |             ^~~~~~~
cmp.cpp: In function 'int compare(int)':
cmp.cpp:30:21: error: 'bit_get' was not declared in this scope
   30 |             int f = bit_get(cur);
      |                     ^~~~~~~
cmp.cpp:35:21: error: 'bit_get' was not declared in this scope
   35 |             int x = bit_get(i);
      |                     ^~~~~~~
cmp.cpp:44:21: error: 'bit_get' was not declared in this scope
   44 |             int x = bit_get(i-1);
      |                     ^~~~~~~
cmp.cpp:51:17: error: 'bit_get' was not declared in this scope
   51 |         int x = bit_get(rr);
      |                 ^~~~~~~