답안 #75797

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
75797 2018-09-11T06:59:16 Z chunghan 콤보 (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include<iostream>
#include<string>
#include<vector>
#include"combo.h"
 
using namespace std;
 
vector<string> str;
 
string guess_sequence(int N) {
  string p = "";
  str.push_back("A");
  str.push_back("B");
  str.push_back("X");
  str.push_back("Y");
  int a = press("AB"), b = press("AX");
  if((a > 0) && (b > 0)) {
    p += "A";
    str.erase(str.begin());
  } else if(a > 0) {
    p += "B";
    str.erase(str.begin()+1);
  } else if(b > 0){
    p += "X";
    str.erase(str.begin()+2);
  } else {
    p += "Y";
    str.erase(str.begin()+3);
  }
  for(int i = 0; i < N-2; i++) {
    string tmp = p + str[0] + str[0] + p + str[0] + str[1] + p + str[0] + str[2] + p + str[1];
    int k = press(tmp);
    if(k == i+2) p += str[0];
    else if(k == i+1) p += str[1];
    else p += str[2];
  }
  a = press(p+str[0]);
  b = press(p+str[1]);
  if(a == N) p += str[0];
  else if(b == N) p += str[1];
  else p += str[2];
  return p;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -