Submission #584616

#TimeUsernameProblemLanguageResultExecution timeMemory
584616supercatex콤보 (IOI18_combo)C++14
10 / 100
59 ms568 KiB
#include <bits/stdc++.h> using namespace std; int press(string); string guess_sequence(int N) { string s = "ABXY"; string a = ""; for (int i = 0; i < s.size() - 1; i++) { string p = string("") + s[i]; if (press(p) == 1) { a = p; break; } } if (a == "") a = s[s.size() - 1]; string p = a; int x = 1; while (x < N) { for (int i = 0; i < s.size(); i++) { if (s[i] == a[0]) continue; string new_p = p + s[i]; int new_x = press(new_p); if (new_x > x) { x = new_x; p = new_p; break; } } } return p; }

Compilation message (stderr)

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