# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
823621 | SoulKnight | 콤보 (IOI18_combo) | C++17 | 0 ms | 208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln '\n'
string B[4] = {"A", "B", "X", "Y"};
string use[3];
string ans, g;
int res;
string guess_sequence(int n){
res = press("AB");
if (res == 2) ans += "A";
else if (res == 1){
ans = ((press("A"))? "A": "B");
} else {
ans = ((press("X"))? "X": "Y");
}
for (int i = 0; i < 4; i++){
if (ans.substr(0, 1) == B[i]) {swap(B[i], B[3]); break;}
}
for (int i = 1; i < n-1; i++){
g = ans + B[0] + B[0] + ans + B[0] + B[1] + ans + B[0] + B[2] + ans + B[1];
res = press(g);
if (res == ans.size() + 2) ans += B[0];
else if (res == ans.size() + 1) ans += B[1];
else ans += B[2];
}
bool ok = false;
for (int i = 0; i < 2; i++){
g = ans + B[i];
if (press(g)) {ans += B[i]; ok = true; break;}
}
if (!ok) ans += B[2];
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |