제출 #1021008

#제출 시각아이디문제언어결과실행 시간메모리
1021008SolikhaCombo (IOI18_combo)C++17
0 / 100
33 ms344 KiB
#include "combo.h"
#include <bits/stdc++.h>
 
 
using namespace std;
 
 
string guess_sequence(int N) {
  string s = "", t = "ABXY", tmp = "";
  for(int i = 0; i < 4; i++){
    if(press(s + t[i]) == 1){
      s += t[i];
    }
  }
  for(int i = 0; i < 4; i++){
    if (t[i] != s[0]) tmp += t[i];
  }
  while(press(s) != N){
    for(int i = 0; i < 3; i++){
      if(press(s + tmp[i]) == s.size() + 1){
        s += tmp[i]; break;
      }
    }
  }
 
  return s;
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |       if(press(s + tmp[i]) == s.size() + 1){
      |          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...