제출 #630447

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

string guess_sequence(int N) {
  string p = "";

  while (p.size()!=N) {
    string pA = p + 'A';
    
    if (press(pA) == p.size() + 1) {
      p += 'A';
      continue;
    }

    string pB = p + 'B';
    if (press(pB) == p.size() + 1) {
      p += 'B';
      continue;
    }

    string pX = p + 'X';
    if (press(pX) == p.size() + 1) {
      p += 'X';
      continue;
    }

    string pY = p + 'Y';
    if (press(pY) == p.size() + 1) {
      p += 'Y';
      continue;
    }

  }

  return p;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:18: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    8 |   while (p.size()!=N) {
      |          ~~~~~~~~^~~
combo.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     if (press(pA) == p.size() + 1) {
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:17:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     if (press(pB) == p.size() + 1) {
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     if (press(pX) == p.size() + 1) {
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:29:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     if (press(pY) == p.size() + 1) {
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...