Submission #995535

#TimeUsernameProblemLanguageResultExecution timeMemory
995535MarszpaceCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
/* * With a little appreciation, in a mostly hollow tone, she says, "Delightful." As if the world has any meaning. * TASK : IOI18_combo * AUTHOR : Marszpace */ #include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { // First string pref=""; { int c1 = press("AX"),c2; if(c1==1){ c2=press("A"); if(c2==1){pref.push_back('A');} else{pref.push_back('X');} } else{ c2=press("B"); if(c2==1){pref.push_back('B');} else{pref.push_back('Y');} } } // 2 - N-1 string button="ABXY"; button.erase(find(button.begin(),button.end(),pref[0])); for(int i=2;i<=N-1;i++){ int ans=press( pref+button[2]+button[0]+ pref+button[2]+button[1]+ pref+button[2]+button[2]+ pref+button[1]); pref.push_back(button[ans-pref.size()]); } // Last { int c1=press(pref+button[0]); if(c1-1==(int)pref.size()){ pref.push_back(button[0]); } else{ int c2=press(pref+button[1]); if(c2-1==(int)pref.size()){ pref.push_back(button[1]); } else{ pref.push_back(button[2]); } } } return pref; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:12: error: 'press' was not declared in this scope
   14 |   int c1 = press("AX"),c2;
      |            ^~~~~
combo.cpp:17:5: error: 'c2' was not declared in this scope; did you mean 'c1'?
   17 |     c2=press("A");
      |     ^~
      |     c1
combo.cpp:22:5: error: 'c2' was not declared in this scope; did you mean 'c1'?
   22 |     c2=press("B");
      |     ^~
      |     c1
combo.cpp:34:13: error: 'press' was not declared in this scope
   34 |     int ans=press(
      |             ^~~~~
combo.cpp:44:10: error: 'press' was not declared in this scope
   44 |   int c1=press(pref+button[0]);
      |          ^~~~~