Submission #767830

#TimeUsernameProblemLanguageResultExecution timeMemory
767830Alihan_8Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define pb push_back #define ln '\n' //#define int long long #ifndef FILE #include "grader.cpp" #endif // FILE template <class _T> bool chmin(_T &x, const _T &y){ bool flag = false; if ( x > y ){ x = y; flag |= true; } return flag; } template <class _T> bool chmax(_T &x, const _T &y){ bool flag = false; if ( x < y ){ x = y; flag |= true; } return flag; } string guess_sequence(int N){ string s; if ( press("AB") ){ s += press("A") ? 'A' : 'B'; } else { s += press("X") ? 'X' : 'Y'; } if ( N == 1 ){ return s; } vector <char> R; for ( auto i: "ABXY" ){ if ( s[0] != i ){ R.pb(i); } } for ( int i = 2; i < N; i++ ){ auto f = press(s + R[0] + s + R[1] + R[0] + s + R[1] + R[1] + s + R[1] + R[2]); if ( f == i - 1 ){ s += R[2]; } else if ( f == i ){ s += R[0]; } else{ assert(f == i + 1); s += R[1]; } } if ( press(s + R[0]) == N ){ s += R[0]; } else if ( press(s + R[1]) == N ){ s += R[1]; } else s += R[2]; return s; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cciFD8tY.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/cculc5nV.o:combo.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/cciFD8tY.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cculc5nV.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status