Submission #975757

#TimeUsernameProblemLanguageResultExecution timeMemory
975757marinalucaCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
char ans[1000010]; int v[1000010], rez[1000010], mat[20][1000010], k; void Init(){} void Typeletter (char L){ ans[v[++ k] = k] = L; rez[k] = rez[mat[0][k] = v[k - 1]] + 1; for (int i = 1; i < 20; ++ i){ mat[i][k] = mat[i - 1][mat[i - 1][k]]; } } void UndoCommands(int U){v[++ k] = v[k - U - 1];} char GetLetter(int P){ int a = v[k]; for (int i = 20; i --;){ if (rez[mat[i][a]] > P) a = mat[i][a]; } return ans[a]; }

Compilation message (stderr)

scrivener.cpp: In function 'void Typeletter(char)':
scrivener.cpp:5:11: warning: operation on 'k' may be undefined [-Wsequence-point]
    5 |     ans[v[++ k] = k] = L;
      |           ^~~~
scrivener.cpp:5:11: warning: operation on 'k' may be undefined [-Wsequence-point]
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:11:28: warning: operation on 'k' may be undefined [-Wsequence-point]
   11 | void UndoCommands(int U){v[++ k] = v[k - U - 1];}
      |                            ^~~~
/usr/bin/ld: /tmp/ccVogvL4.o: in function `main':
grader.cpp:(.text.startup+0xff): undefined reference to `TypeLetter(char)'
collect2: error: ld returned 1 exit status