Submission #962595

#TimeUsernameProblemLanguageResultExecution timeMemory
962595Mohamed_Kachef06Combo (IOI18_combo)C++17
10 / 100
25 ms1216 KiB
#include <bits/stdc++.h> #include "combo.h" //#include "grader.cpp" using namespace std; string guess_sequence(signed N){ char a[] = {'A' , 'B' , 'X' , 'Y'}; string s; for (int i = 0 ; i < 4 ; i++) {if (press(s+a[i])) {s+=a[i]; break;}}; for (int i = 0 ; i < N-1 ; i++){ random_shuffle(a , a+4); for (int j = 0 ; j < 4 ; j++) if (a[j] != s[0]) if (press(s+a[j]) > s.size()) {s+=a[j]; break;} } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:73: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |       for (int j = 0 ; j < 4 ; j++) if (a[j] != s[0]) if (press(s+a[j]) > s.size()) {s+=a[j]; break;}
      |                                                           ~~~~~~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...