Submission #544621

#TimeUsernameProblemLanguageResultExecution timeMemory
544621LunaMemeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef vector<pair<int, int>> vii; typedef vector<int> vi; typedef long long ll; #define PB push_back #define MP make_pair #define FOR(i, x, y) for (ll i = x; i < y ; i ++) #include <combo.h> string guess_sequence(int n){ string s; string l[] = {"A", "B", "X", "Y"}; string start; int num = 0; vector<string> m; if (press("AB")){ if (press("A")){ start ="A"; } else start = "B"; } else if (press("X")) start = "X"; else start = "Y"; s = start; FOR(i, 0, 4){ if (l[i] != start){ m.PB(l[i]); } } FOR(i, 0, num - 2){ int guess = press(s + m[0] + s + m[1] + m[0] + s + m[1] + m[1] + s + m[1] + m[2]); if (guess = 0){ s += m[2] } else if (guess == 1){ s += m[0]; } else { s += m[2]; } } if (press("AB")){ if (press("A")){ s += "A"; } else s += "B"; } else if (press("X")) s +="X"; else s +="Y"; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:34:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   34 |         if (guess = 0){
      |             ~~~~~~^~~
combo.cpp:35:22: error: expected ';' before '}' token
   35 |             s += m[2]
      |                      ^
      |                      ;
   36 |         }
      |         ~