Submission #1100449

#TimeUsernameProblemLanguageResultExecution timeMemory
1100449dzhoz0Combo (IOI18_combo)C++17
30 / 100
36 ms1212 KiB
/* ghmt the cutie :3 UwU */ #include "combo.h" #include <bits/stdc++.h> using namespace std; #define INF 1e18 #define f first #define s second #define pii pair<int, int> #define vi vector<int> string guess_sequence(int N) { mt19937 rng(69420); vector<char> v = {'A', 'B', 'X', 'Y'}; string p = ""; for(int i = 0; i < 3; i++) { char c = v[i]; p += c; if(press(p) == 1) { reverse(v.begin() + i, v.end()); break; } p.pop_back(); } if(p == "") p += v[3]; v.pop_back(); // cout << v.size() << '\n'; for(int i = 1; i < N; i++) { shuffle(v.begin(), v.end(), rng); for(int j = 0; j < 2; j++) { p += v[j]; if(press(p) == i + 1) { break; } p.pop_back(); } if(p.size() != i + 1) { p += v[2]; } } return p; }

Compilation message (stderr)

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