Submission #76695

#TimeUsernameProblemLanguageResultExecution timeMemory
76695thebesCombo (IOI18_combo)C++14
100 / 100
84 ms696 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string s, t, idk; string guess_sequence(int N){ if(press("AB")){ if(press("A")) s = "A", idk="BXY"; else s = "B", idk="AXY"; } else{ if(press("X")) s = "X", idk="ABY"; else s = "Y", idk="ABX"; } if(N==1) return s; for(int i=2;i<N;i++){ t = s+idk[0]+s+idk[1]+idk[0]+s+idk[1]+idk[1]+s+idk[1]+idk[2]; assert(t.size() <= 4*N); int m = press(t); if(m == i-1) s += idk[2]; else if(m == i) s += idk[0]; else s += idk[1]; } int a = press(s+idk[0]), b = press(s+idk[1]); if(a != N-1) s += idk[0]; else if(b != N-1) s += idk[1]; else s += idk[2]; return s; }

Compilation message (stderr)

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from combo.cpp:2:
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:25: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   19 |         assert(t.size() <= 4*N);
      |                ~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...