| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 139899 | vince | 콤보 (IOI18_combo) | C++14 | 2 ms | 308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
string C;
string guess_sequence(int N)
{
string S = "";
int a = press("AX");
int b = press("BY");
if(a)
{
int x = press("A");
if(x) S = "A", C = "BXY";
else S = "X", C = "ABY";
}
if(b)
{
int x = press("B");
if(x) S = "B", C = "AXY";
else S = "Y", C = "ABX";
}
while(1)
{
string T = S + C.substr(0,1);
for(int i = 0; i < 3; i++)
{
T += S + C.substr(1,1) + C.substr(i, 1);
}
int val = press(T);
if(val == S.size()+1)
S += C.substr(0,1);
else if(val == S.size()+2)
S += C.substr(1,1);
else
S += C.substr(2,1);
// cout << S << "\n";
if(S.size() == N-1)
break;
}
string T = S + C.substr(0,1) + S + C.substr(1,1);
int x = press(T);
if(x == N)
{
if(press(S + C.substr(0,1)) == N)
return S + C.substr(0,1);
else return S + C.substr(1,1);
}
else return S + C.substr(2,1);
return S;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
