제출 #647612

#제출 시각아이디문제언어결과실행 시간메모리
647612TruitadepatatesCombo (IOI18_combo)C++14
10 / 100
62 ms564 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

const int M = 4;
const char LET[] = "ABXY";

string guess_sequence(int N) {
  string s;

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M-1; j++) {
      int len = press(s + LET[j]);
      if (len == i+1) {
        s += LET[j];
        break;
      }
    }
    if (s.size() != i+1) {
      s += LET[M-1];
    }
  }
  return s;
}

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

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