Submission #554086

#TimeUsernameProblemLanguageResultExecution timeMemory
554086d4xnCombo (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include "combo.h" #pragma GCC optimize ("Ofast") #include <bits/stdc++.h> using namespace std; #define pb push_back set<pair<int, char>> vis; string guess_sequence(int N) { string p; for (char i : {'A', 'B', 'X', 'Y'}) { p.pb(i); if (press(p)) { for (int i = 1; i < N; i++) { p.pb(i); } break; } p.pop_back(); } vector<char> v; for (char i : {'A', 'B', 'X', 'Y'}) { if (p[0] == i) continue; v.pb(i); } int idx = 1; while (idx < N) { for (int j = 0; j < 3; j++) { int k = j + rand() % (3 - j); swap(v[j], v[k]); } for (int i = idx+1; i - idx + 1 <= idx && i < N; i++) { while (p[i] == p[0] || vis.count(make_pair(i, p[i]))) { p[i] = v[rand() % 3]; } } int idx = press(p); } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:46:9: warning: unused variable 'idx' [-Wunused-variable]
   46 |     int idx = press(p);
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...