Submission #528647

#TimeUsernameProblemLanguageResultExecution timeMemory
528647rayfishCombo (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include <climits> #include <iostream> #include <algorithm> #include <cmath> #include <deque> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #include <unordered_map> #include <utility> #include <vector> #include "combo.h" using namespace std; using ll = long long; //int press(string s) { // return 0; //} string guess_sequence(int N) { string cur; char letters[] {'A', 'B', 'X', 'Y'}; // find first letter char first; if (press(cur + letters[0]) == 1) { first = letters[0]; } else if (press(cur + letters[1]) == 1) { first = letters[1]; } else if (press(cur + letters[2]) == 1) { first = letters[2]; } else { first = letters[3]; } cur += first; // array without first char n_letters[3]; int nxt = 0; for (char c : letters) { if (c != first) n_letters[nxt++] = c; } // find next letters for (int i = 1; i < N; i++) { int p_len = press(cur + n_letters[0] + n_letters[0] + cur + n_letters[0] + n_letters[1] + cur + n_letters[0] + n_letters[2] + cur + n_letters[1]); if (p_len == i) cur += n_letters[2]; else if (p_len == i + 1) cur += n_letters[1]; else cur += n_letters[0]; } return cur; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...