Submission #943788

#TimeUsernameProblemLanguageResultExecution timeMemory
943788studyCombo (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define REP(i,n) for (int i=0; i<(n); i++) const int M = 4; const char LET[] = "ABXY"; string guess_sequence(int N){ int idx[M]; REP(i,M){idx[i]=i;} int len[M]; string s; REP(i,N){ random_shuffle(idx,idx+M); REP(j,M-1){ len[j] = press(s+LET[idx[j]]); if (len[idx[j]] == i+1){ s += LET[idx[j]]; break; } } if (s.size() != i+1){ s += LET[idx[M-1]]; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:30: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   23 |                 if (s.size() != i+1){
      |                     ~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...