제출 #587802

#제출 시각아이디문제언어결과실행 시간메모리
587802IvanJ콤보 (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include "combo.h" #include<bits/stdc++.h> #define all(a) (a).begin(), (a).end() using namespace std; string guess_sequence(int n) { string p = "", s = ""; if(press("A")) s = "A"; else if(press("B")) s = "B"; else if(press("X")) s = "X"; else s = "Y"; set<string> S; S.insert("A"), S.insert("B"), S.insert("X"), S.insert("Y"); S.erase(s); vector<string> v(all(S)); for(int i = 1;i < n - 1;i++) { p = s + v[0]; for(int j = 0;j < 3;j++) p += s + v[1] + v[j]; int x = press(p); if(x == s.size() + 1) s += v[0]; else if(x == s.size() + 2) s += v[1]; else s += v[2]; } if(press(s + "A")) s += "A"; else if(press(s + "B")) s += "B"; else if(press(s + "X")) s += "X"; else s += "Y"; return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   if(x == s.size() + 1) s += v[0];
      |      ~~^~~~~~~~~~~~~~~
combo.cpp:25:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   else if(x == s.size() + 2) s += v[1];
      |           ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...