Submission #1263595

#TimeUsernameProblemLanguageResultExecution timeMemory
1263595piolkCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<char> buttons={'A','B','X','Y'}; string S="AB"; int N=S.size(); int press(string p); string guess_sequence(int N){ string soFar; vector<char> av; if (press("AB")>0){ if (press("A")==1){ soFar="A"; } else { soFar="B"; } } else { if (press("X")==1){ soFar="X"; } else { soFar="Y"; } } if (N==1) return soFar; for (int i=0;i<4;i++){ if (buttons[i]==soFar[0]) continue; av.push_back(buttons[i]); } while (soFar.size()<N-1){ int size=soFar.size(); string pat=(soFar+av[0]+av[0]) + (soFar+av[0]+av[1]) + (soFar+av[0]+av[2]) + (soFar+av[1]); int wynik=press(pat); if (wynik==size+2) soFar.push_back(av[0]); else if (wynik==size+1) soFar.push_back(av[1]); else soFar.push_back(av[2]); } if (press(soFar+av[0])==N){ soFar.push_back(av[0]); } else if (press(soFar+av[1])==N){ soFar.push_back(av[1]); } else { soFar.push_back(av[2]); } return soFar; } int main(){ cout<<(guess_sequence(N)==S); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccAhuync.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccUuiniZ.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status