| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1317976 | 12345678 | 콤보 (IOI18_combo) | C++17 | 0 ms | 400 KiB |
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string res;
vector<char> op={'A', 'B', 'X', 'Y'}, new_op; // new_op contains only the one not in first character
char st;
if (press("AB"))
{
if (press("A")) st='A';
else st='B';
}
else
{
if (press("X")) st='X';
else st='Y';
}
res=st;
if (N==1) return res;
for (int i=0; i<4; i++) if (st!=op[i]) new_op.push_back(op[i]);
for (int i=1; i<N-1; i++)
{
string s=(res+new_op[0])+(res+new_op[1]+new_op[0])+(res+new_op[1]+new_op[1])+(res+new_op[1]+new_op[2]);
int p=press(s);
if (p==res.size()) res+=new_op[2];
else if (p==res.size()+1) res+=new_op[0];
else res+=new_op[1];
}
for (int i=0; i<2; i++) if (press(res+new_op[i])==N) return res+new_op[i];
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
