Submission #536894

#TimeUsernameProblemLanguageResultExecution timeMemory
536894Hydroxic_AcidSpeedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#include "speedrun.h" void assignHints(int subtask, int N, int A[], int B[]) { setHintLen(20); intcen = 0; if(A[0] == A[1] || A[0] == B[1]) cen = A[0]; else cen = B[0]; for(int i = 0; i < N; i++){ int j = 1; int temp = cen; while(temp){ if(temp&-temp == 1){ setHint(i, j, true); temp--; } temp >> 1; j++; } } } void speedrun(int subtask, int N, int start) { int cen = 0; for(int i = 1; i <= 10; i++){ if(getHint(i)) cen++; cen << 1; } int left = N - 1; while(left > 0){ if(start == cen){ while(!goTo(N))N--; N--; } else{ left--; goTo(cen); } } }

Compilation message (stderr)

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:5:5: error: 'intcen' was not declared in this scope
    5 |     intcen = 0;
      |     ^~~~~~
speedrun.cpp:6:38: error: 'cen' was not declared in this scope
    6 |     if(A[0] == A[1] || A[0] == B[1]) cen = A[0];
      |                                      ^~~
speedrun.cpp:7:10: error: 'cen' was not declared in this scope
    7 |     else cen = B[0];
      |          ^~~
speedrun.cpp:10:14: error: 'cen' was not declared in this scope
   10 |   int temp = cen;
      |              ^~~
speedrun.cpp:12:18: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   12 |    if(temp&-temp == 1){
      |            ~~~~~~^~~~
speedrun.cpp:16:9: warning: statement has no effect [-Wunused-value]
   16 |    temp >> 1; j++;
      |    ~~~~~^~~~
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:26:7: warning: statement has no effect [-Wunused-value]
   26 |   cen << 1;
      |   ~~~~^~~~