# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1111432 | SalihSahin | 콤보 (IOI18_combo) | C++14 | 1 ms | 560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#include "combo.h"
using namespace std;
std::string guess_sequence(int N) {
string p = "A", ans = "";
int c = press(p);
if(c) ans += 'A';
p = "B";
c = press(p);
if(c && !ans.size()) ans += 'B';
p = "X";
c = press(p);
if(c && !ans.size()) ans += 'X';
p = "X";
if(!ans.size()) ans += 'Y';
vector<char> other;
if(ans == "A"){
other.pb('B');
other.pb('X');
other.pb('Y');
}
if(ans == "B"){
other.pb('A');
other.pb('X');
other.pb('Y');
}
if(ans == "X"){
other.pb('B');
other.pb('A');
other.pb('Y');
}
if(ans == "Y"){
other.pb('B');
other.pb('X');
other.pb('A');
}
for(int i = 1; i <= N-2; i++){
p = "";
p += (ans + other[1]); // just add other[1]
p += (ans + other[2] + other[0]);
p += (ans + other[2] + other[1]);
p += (ans + other[2] + other[2]);
int len = press(p);
if(len == i) ans += other[0];
else if(len == i + 1) ans += other[1];
else ans += other[2];
}
for(int i = 0; i < 2; i++){
p = ans + other[i];
c = press(p);
if(c == N){
ans += other[i];
break;
}
}
if(ans.size() < N) ans += other[2];
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |