Submission #615597

#TimeUsernameProblemLanguageResultExecution timeMemory
615597ShithilaCombo (IOI18_combo)C++14
30 / 100
73 ms480 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { std::string p = ""; int len=0; string letter[4]={"A","B","X","Y"}; int first=3; for(int i=0;i<3;i++) { string pas=p+letter[i]; if(press(pas)==1) { first=i; p=pas; break; } } if(first==3) p=p+letter[3]; for(int j=1;j<N;j++) { if(first==3) { int second=2; for(int i=0;i<2;i++) { string pas=p+letter[i]; if(press(pas)==j+1) { second=i; p=pas; break; } } if(second==2) p=p+letter[2]; } else { int second=first+1; for(int i=0;i<second-1;i++) { string pas=p+letter[i]; //cout<<"x"<<endl;; if(press(pas)==j+1) { //cout<<second<<" "<<i<<endl;; second=i; p=pas; break; } } if(second!=first+1) { continue; } for(int i=second+1;i<4;i++) { string pas=p+letter[i]; if(press(pas)==j+1) { second=i; p=pas; break; } } if(second==first+1) p=p+letter[first+1]; } } //cout<<p<<endl; return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:7: warning: unused variable 'len' [-Wunused-variable]
    6 |   int len=0;
      |       ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...