제출 #127111

#제출 시각아이디문제언어결과실행 시간메모리
127111reda콤보 (IOI18_combo)C++14
0 / 100
111 ms292 KiB
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;
string guess_sequence(int N)
{

      string t = "" ,v;

      int a=press("A"),b=press("B"),x=press("X"),y=press("Y");
      if(a){t.push_back('A');

        v= "BXY";

      }
      if(b){
        t.push_back('B');
                v= "AXY";
      }
     if(y)
     {
         t.push_back('Y');
         v="ABX";

     }

     if(x){
        t.push_back('X');
        v="ABY"   ;
     }
     int i=0;
     while(t.size()!=N)
     {
         int h=press(t+v[i%N]);
         if(h)v.push_back(v[i%N]);
         i++;
     }
     return t;
  }

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

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