Submission #480316

#TimeUsernameProblemLanguageResultExecution timeMemory
480316omgCombo (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; for (int i=0;i<N;i++) { loop(R, comboCur); 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:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^