제출 #713275

#제출 시각아이디문제언어결과실행 시간메모리
713275europium콤보 (IOI18_combo)C++17
88 / 100
34 ms636 KiB
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <numeric> #include <cmath> #include <iterator> #include <set> #include <map> #include <math.h> #include <iomanip> #include <unordered_set> #include "combo.h" using namespace std; string guess_sequence(int n) { vector<string> moves = {"A", "B", "X", "Y"}; string s = ""; for (int i = 0; i < 4; i++){ string guess = moves[i]; if (press(guess) == 1){ s += moves[i]; auto it = find(moves.begin(), moves.end(), guess); moves.erase(it); break; } } while (int(s.size()) < n - 1){ string guess = s + moves[0] + s + moves[1] + moves[0] + s + moves[1] + moves[1] + s + moves[1] + moves[2]; int coins = press(guess); if (coins == int(s.size())) s += moves[2]; else if (coins == int(s.size()) + 1) s += moves[0]; else if (coins == int(s.size()) + 2) s += moves[1]; } for (int i = 0; i < 3; i++){ string guess = s + moves[i]; if (press(guess) == int(s.size()) + 1){ s += moves[i]; break; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...