| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 203403 | 0gnjen | 콤보 (IOI18_combo) | C++14 | 65 ms | 684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
std::string guess_sequence(int N)
{
//cout << N << endl;
string s = "";
string c = "ABXY";
if( press("XY") )
{
if(press("X"))s = "X" , c = "ABY";
else s = "Y" , c = "ABX";
}
else
{
if(press("A"))s = "A" , c = "BXY";
else s = "B" , c ="AXY";
}
for(int i = 1; i < N; i++)
{
if(i+1 == N)
{
string ask1 = s;ask1+=c[0];
string ask2 = s;ask2+=c[1];
string ask3 = s;ask3+=c[2];
if(press(ask1) == N)s = ask1;
else if(press(ask2) == N)s = ask2;
else s = ask3;
}
else
{
string ask1 = s ;
ask1+=c[0];
ask1+=s;
ask1+=c[1];
ask1+=c[0];
ask1+=s;
ask1+=c[1];
ask1+=c[1];
ask1+=s;
ask1+=c[1];
ask1+=c[2];
int p = press(ask1);
if(p==i)s+=c[2];
else if(p==i+1)s+=c[0];
else s+=c[1];
}
}
return s;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
