Submission #1325913

#TimeUsernameProblemLanguageResultExecution timeMemory
1325913x_aCombo (IOI18_combo)C++20
0 / 100
0 ms336 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p = "", s = ""; int last = 0; char t = 'x'; vector<char> A = {'A', 'B', 'X', 'Y'}; function<void()> my_rand = [&](){ for(int i = 3; i >= 0; i --){ int j = rand() % (i + 1); swap(A[i], A[j]); } }; for (int i = 0; i < N; ++i) { p = s; int cnt = 0; my_rand(); for(int j = 0; j < 4; j ++){ if(t == A[j]) continue; if((cnt == 2 && i) || (cnt == 3 && i == 0)){ last ++; s += A[j]; break; } int x = press(p + A[j]); if(x > last){ if(last == 0){ t = A[j]; } s += A[j]; last = x; break; } else{ cnt ++; } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...