Submission #630450

#TimeUsernameProblemLanguageResultExecution timeMemory
630450NintsiChkhaidze콤보 (IOI18_combo)C++14
10 / 100
59 ms456 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

vector <char> v = {'A', 'B', 'X', 'Y'};
string guess_sequence(int N) {
  string S = "";
  char f = '1';
  
  while (S.size()!=N) {
    for (char c: v){
      if (c == f) continue;
      string P = S + c;
      if (press(P) == S.size() + 1) {
        S = P; 
        break;
      }
    }

    if (S.size() == 1) f = S[0];
  }

  return S;
}

Compilation message (stderr)

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