| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 667056 | irmuun | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
#define pb push_back
#define ll long long
char ch[4];
string s;
string add(int x,int y){
string t=s;
t+=ch[x];
t+=ch[y];
return t;
}
string guess_sequence(int n){
if(press("AB")){
if(press("A")>0){
s+='A';
}
else{
s+='B';
}
}
else{
if(press("X")>0){
s+='X';
}
else{
s+='Y';
}
}
if(n==1){
return s;
}
int cur=0;
string button="ABXY";
for(int i=0;i<4;i++){
if(s[0]!=button[i]){
ch[cur]=button[i];
cur++;
}
}
for(int i=1;i<n-1;i++){
string t=add(0,0)+s+add(0,1)+s+add(0,2)+s+ch[1];
int x=press(x);
if(x==i+2){
s+=ch[0];
}
else if(x==i+1){
s+=ch[1];
}
else{
s+=ch[2];
}
}
string st=s;
st+=ch[0];
if(press(st)==n){
return st;
}
st=s;
s+=ch[1];
if(press(st)==n){
return st;
}
s+=ch[2];
return s;
}
