Submission #78709

#TimeUsernameProblemLanguageResultExecution timeMemory
78709wleung_bvgCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define eb emplace_back #define mp make_pair #define f first #define s second #define all(a) (a).begin(),(a).end() #define For(i,a,b) for(auto i=(a);i<(b);i++) #define FOR(i,b) For(i,0,b) #define Rev(i,a,b) for(auto i=(a);i>(b);i--) #define REV(i,a) Rev(i,a,-1) #define FORE(i,a) for(auto&&i:a) #define sz(a) (int((a).size())) using ll=long long;using ld=long double;using uint=unsigned int;using ull=unsigned long long; using pii=pair<int,int>;using pll=pair<ll,ll>;using pill=pair<int,ll>;using plli=pair<ll,int>;using pdd=pair<double,double>;using pld=pair<ld,ld>; constexpr const char nl='\n',sp=' ';constexpr const int INT_INF=0x3f3f3f3f;constexpr const ll LL_INF=0x3f3f3f3f3f3f3f3f; constexpr const double D_INF=numeric_limits<double>::infinity();constexpr const ld LD_INF=numeric_limits<ld>::infinity();constexpr const double EPS=1e-9; string guess_sequence(int N) { string S = press("AB") ? (press("A") ? "A" : "B") : (press("X") ? "X" : "Y"); if (N == 1) return S; string ch = ""; FORE(c, "ABXY") if (S[0] != c) ch.pb(c); For(i, 1, N - 1) S.pb(ch[press(S + ch[1] + S + ch[2] + ch[0] + S + ch[2] + ch[1] + S + ch[2] + ch[2]) - i]); return press(S + ch[0] + S + ch[1]) == N ? (press(S + ch[0]) == N ? S + ch[0] : S + ch[1]) : (S + ch[2]); } int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N; cin >> N; cout << guess_sequence(N) << nl; return 0; }

Compilation message (stderr)

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