# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
554904 | d4xn | Combo (IOI18_combo) | C++17 | 1 ms | 276 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
string guess_sequence(int N) {
string p;
string dict1 = "ABXY";
/*
int x = press("AB");
if (x >= 1) {
if (press("A")) {
p.pb('A');
}
else {
p.pb('B');
}
}
else {
if (press("X")) {
p.pb('X');
}
else {
p.pb('Y');
}
}
*/
if (press("A")) {
p.pb('A');
}
else if (press("B")) {
p.pb('B');
}
else if (press("X")) {
p.pb('X');
}
else {
p.pb('Y');
}
string dict2;
for (char &c : dict1) {
if (c == p[0]) continue;
dict2.pb(c);
}
for (int i = 1; i < N-1; i++) {
string s1 = p;
s1.pb(dict2[0]);
string s2 = p;
s2.pb(dict2[1]);
s2.pb(dict2[0]);
string s3 = p;
s3.pb(dict2[1]);
s3.pb(dict2[1]);
string s4 = p;
s4.pb(dict2[1]);
s4.pb(dict2[2]);
int y = press(s1 + s2 + s3 + s4);
if (y == i+1) {
p.pb(dict2[0]);
}
else if (y == i+2) {
p.pb(dict2[1]);
}
else {
p.pb(dict2[2]);
}
}
for (int i = 0; i < 2; i++) {
char c = dict2[i];
p.pb(c);
if (press(p) == N) break;
p.pop_back();
}
if (p.size() < N) {
p.pb(dict2[2]);
}
return p;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |