답안 #335295

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
335295 2020-12-11T20:55:48 Z fadi57 콤보 (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include "combo.h"
#include <bits/stdc++.h>

//#include"grader.cpp"
using namespace std;
std::string guess_sequence(int N) {
  std::string p = "";
string s[4]={"A","B","X","Y"};
string first;
/*
for(int i=0;i<4;i++){
p=s[i];
int ok=press(p);
//cout<<ok;
if(ok==1){
   first=s[i]; break;
}
}*/
int query=press("AB");
string ret;
if(query){
    ret=press("A")?"A":"B";
}else{

 ret=press("X")?"X":"Y";
}

first=ret;


int si=N;si--;
int now=2;
while(si){
        int coun=0;
  for(int i=0;i<4;i++){
if(s[i]==first){continue;}
if(coun<2){
int ok=press(ret+s[i]);
if(ok==now){
    ret+=s[i];
        now++;
    break;
}else{coun++;}}else{
ret+=s[i];now--;
break;
}
}si--;
}cout<<ret;
  return ret;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB DO NOT PRINT ANYTHING TO STANDARD OUTPUT
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB DO NOT PRINT ANYTHING TO STANDARD OUTPUT
2 Halted 0 ms 0 KB -