| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 76355 | arock | 콤보 (IOI18_combo) | C++14 | 2 ms | 200 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
char first = press("AB") == 0? "YA"[press("X")]:
"BA"[press("A")];
char a, b, c;
if(first == 'A') a = 'B', b = 'X', c = 'Y';
if(first == 'B') a = 'A', b = 'X', c = 'Y';
if(first == 'X') a = 'A', b = 'B', c = 'Y';
if(first == 'Y') a = 'A', b = 'B', c = 'X';
std::string S(1, first);
while(S.length() + 2 <= N) {
int coins = press(S + a + a + S + a + b + S + b + a) - S.length();
if (coins == 0) {
S += c;
} else if (coins == 1) {
coins = press(S + b + c) - S.length();
if (coins == 0) {
S += a, S += c;
} else if (coins == 1) {
S += b, S += b;
} else if (coins == 2) {
S += b, S += c;
}
} else if (coins == 2) {
coins = press(S + a + b) - S.length();
if (coins == 0) {
S += b, S += a;
} else if (coins == 1) {
S += a, S += a;
} else if (coins == 2) {
S += a, S += b;
}
}
}
if (S.length() < N) {
if (press(S + a) - S.length() == 1) {
S += a;
} else if(press(S + b) - S.length() == 1) {
S += b;
} else {
S += c;
}
}
return S;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
