Submission #480317

#TimeUsernameProblemLanguageResultExecution timeMemory
480317omgCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void loop(string R, int combo) { R.push_back('A'); if (press(R) > combo) return; R.pop_back(); R.push_back('B'); if (press(R) > combo) return; R.pop_back(); R.push_back('X'); if (press(R) > combo) return; R.pop_back(); R.push_back('Y'); if (press(R) > combo) return; R.pop_back(); } string guess_sequence(int N) { string R=""; int comboCur=0; string target="AXYZ"; for (int i=0;i<N;i++) { for (int j=0;j<4; j++) { R.push_back(target[j]); if (press(R) > comboCur) break; R.pop_back(); } comboCur++; } cout<<R; }

Compilation message (stderr)

combo.cpp: In function 'void loop(std::string, int)':
combo.cpp:5:7: error: 'press' was not declared in this scope
    5 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:8:7: error: 'press' was not declared in this scope
    8 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:11:7: error: 'press' was not declared in this scope
   11 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:14:7: error: 'press' was not declared in this scope
   14 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:11: error: 'press' was not declared in this scope
   24 |       if (press(R) > comboCur) break;
      |           ^~~~~
combo.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^