# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
749959 | CDuong | 콤보 (IOI18_combo) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")
*/
#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pii>
using namespace std;
const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
const ll oo = 1e18;
char c[] = {'A', 'B', 'X', 'Y'};
string guess_sequence(int N) {
int n = N;
int cur = press("AB");
string s;
if(cur == 1) {
cur = press("A");
if(cur) s = "A";
else s = "B";
}
else {
cur = press("X");
if(cur) s = "X";
else s = "Y";
}
vector<char> sadge;
for(int i = 0; i < 4; ++i)
if(c[i] != s[0])
sadge.emplace_back(c[i]);
for(int i = (int)s.size(); i < n - 1; ++i) {
tmp += s;
tmp.pb(s[0]);
tmp.pb(s[0]);
tmp += s;
tmp.pb(s[0]);
tmp.pb(s[1]);
tmp += s;
tmp.pb(s[0]);
tmp.pb(s[2]);
tmp += s;
tmp.pb(s[1]);
int cur = press(tmp);
if(tmp == i) s.pb(s[2]);
else if(tmp - 1 == i) s.pb(s[1]);
else s.pb(s[0]);
}
string tmp = s;
tmp.pb(s[0]);
if(press(tmp)) {
s.pb(s[0]);
return s;
}
tmp.pop_back();
tmp.pb(s[1]);
if(press(tmp)) {
s.pb(s[1]);
return s;
}
s.pb(s[2]);
return s;
}