Submission #1194591

#TimeUsernameProblemLanguageResultExecution timeMemory
1194591Cebrayil09콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair < int , int > #define eb emplace_back #define pb push_back //#define int long long #define fi first #define se second string guess_sequence(int n) { char hrf[4] = {'A','B','X','Y'}; int say[4] = {0,0,0,0}; for(int i = 0;i < 4;i++) { string s = ""; for(int j = 1;j <= n;j++) s.pb(hrf[i]); say[i] = press(s); } string s = ""; for(int i = 1;i <= n;i++) { for(int j = 0;j < 4;j++) { if(say[j] == 0) continue; string test = s; test.pb(hrf[j]); if(i == 1) { if(say[j] == 1) { int c = press(test); if(c == test.size()) { say[j]--; s = test; break; } } continue; } int c = press(test); if(c == test.size()) { say[j]--; s = test; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:18: error: 'press' was not declared in this scope
   19 |         say[i] = press(s);
      |                  ^~~~~
combo.cpp:32:29: error: 'press' was not declared in this scope
   32 |                     int c = press(test);
      |                             ^~~~~
combo.cpp:42:21: error: 'press' was not declared in this scope
   42 |             int c = press(test);
      |                     ^~~~~