Submission #93380

#TimeUsernameProblemLanguageResultExecution timeMemory
93380temoyanteladzeCombo (IOI18_combo)C++14
0 / 100
2 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string s=""; string v="ABXY"; if (press("A")) s+="A"; if (press("B")) s+="B"; if (press("X")) s+="X"; if (s.empty()) s+="Y"; int k=v.find(s); v.erase(v.begin()+k); for (int i=2;i<n;i++) { int p=press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]); if (p==i) s+=v[0]; if (p==i+1) s+=v[1]; if (p==i-1) s+=v[2]; } if (press(s+v[0])==n) s+=v[0]; if (press(s+v[1])==n) s+=v[1]; int cnt=s.size(); if (cnt==n-1) s+=v[2]; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   33 |  if (press(s+v[1])==n)
      |  ^~
combo.cpp:35:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   35 |   int cnt=s.size();
      |   ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...