Submission #390295

#TimeUsernameProblemLanguageResultExecution timeMemory
390295MarceantasyCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int mxN = 2e5, M = 1e9+7; int N; string guess_sequence(int N){ string sequence = ""; string chars = "ABXY"; if(press("AB")){ if(press("A")){ sequence+="A"; chars.erase(chars.find("A"), 1); }else{ sequence+="B"; chars.erase(chars.find("B"), 1); } }else{ if(press("X")){ sequence+="X"; chars.erase(chars.find("X"), 1); }else{ sequence+="Y"; chars.erase(chars.find("Y"), 1); } } int val = 1; for(int i = 1; i<N; ++i){ int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]); if(points == i){ sequence+=chars[2]; }else if(points == i+1){ sequence+=chars[0]; }else{ sequence+=chars[1]; } val++; } if(press(sequence+chars[0]+sequence+chars[1]) == val+1){ if(press(sequence+chars[0])){ sequence+=chars[0]; }else{ sequence+=chars[1]; } }else{ sequence+=chars[2]; } return sequence; } int press(string s){ ; } int main(){ cin >> N; guess_sequence(N); }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:8: error: 'press' was not declared in this scope
   13 |     if(press("AB")){
      |        ^~~~~
combo.cpp:32:22: error: 'press' was not declared in this scope
   32 |         int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]);
      |                      ^~~~~
combo.cpp:42:8: error: 'press' was not declared in this scope
   42 |     if(press(sequence+chars[0]+sequence+chars[1]) == val+1){
      |        ^~~~~
combo.cpp: In function 'int press(std::string)':
combo.cpp:56:1: warning: no return statement in function returning non-void [-Wreturn-type]
   56 | }
      | ^