| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 282688 | peti1234 | 콤보 (IOI18_combo) | C++17 | 1 ms | 200 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include "combo.h";
using namespace std;
string s, p;
int x, y;
char a='A', b='B', c='X';
/*int press(string s) {
cout.flush() << s << endl;
int a;
cin >> a;
return a;
}*/
string guess_sequence(int n) {
x=press("AB");
y=press("AX");
if (x && y) s+=a, a='Y';
if (x && !y) s+=b, b='Y';
if (!x && y) s+=c, c='Y';
if (!x && !y) s+='Y';
for (int i=1; i<n-1; i++) {
p=s+a+a+s+a+b+s+a+c+s+b;
x=press(p);
if (x==i+2) s+=a;
if (x==i+1) s+=b;
if (x==i) s+=c;
}
p=s+a;
x=press(p);
p=s+b;
y=press(p);
if (x>y) s+=a;
if (y>x) s+=b;
if (x==y) s+=c;
return s;
}
/*
int main() {
int f;
cin >> f;
guess_sequence(f);
return 0;
}
*/컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
