Submission #1085435

#TimeUsernameProblemLanguageResultExecution timeMemory
1085435minggaCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; #define ln "\n" #define dbg(x) cout << #x << " = " << x << ln #define mp make_pair #define pb push_back #define fi first #define se second #define inf 2e18 #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define out(file) freopen(file, "w", stdout) #define in(file) freopen(file, "r", stdin) #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) // #define int long long int MOD = 1e9 + 7; string d[4] = {"A", "B", "X", "Y"}; string guess_sequence(int n) { string ans = ""; if(press("AB") > 0) { if(press("A") == 1) ans += 'A'; else ans += 'B'; } else { if(press("X") == 1) ans += 'X'; else ans += 'Y'; } string fir = ans; vector<string> vec; for(int i = 0; i < 4; i++) { if(d[i] == fir) continue; vec.pb(d[i]); } for(int i = 1; i < n; i++) { srting tmp = ""; for(int j = 0; j < 3; j++) { tmp += ans + vec[0] + vec[j]; } tmp += ans + vec[1]; int cur = press(tmp); if(cur == 2) { ans += vec[0]; } else if(cur == 1) { ans += vec[1]; } else ans += vec[2]; } return ans; } // signed main() { // string a = ""; // a += d[1] + d[2] + d[0]; // string tmp = a + d[0] + a + d[1] + a + d[2] + a + d[3]; // cout << tmp; // }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:41:5: error: 'srting' was not declared in this scope
   41 |     srting tmp = "";
      |     ^~~~~~
combo.cpp:43:7: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   43 |       tmp += ans + vec[0] + vec[j];
      |       ^~~
      |       tm
combo.cpp:45:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   45 |     tmp += ans + vec[1];
      |     ^~~
      |     tm