제출 #710993

#제출 시각아이디문제언어결과실행 시간메모리
710993Foxyy콤보 (IOI18_combo)C++17
0 / 100
0 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> char getSingleChar(std::string str) { char ret; if (press(str+"AB") > str.size()) { if (press(str+"A") > str.size()) { ret = 'A'; } else { ret = 'B'; } } else { if (press("X") > str.size()) { ret = 'X'; } else { ret = 'Y'; } } return ret; } std::string guess_sequence(int N) { char first = getSingleChar(""); std::string str = std::string() + first; std::set<char> s{'A', 'B', 'X', 'Y'}; s.erase(first); std::vector<char> cset(s.begin(), s.end()); for (int i = 2; i < N; i++) { int c = press(str + cset[0] + str + cset[1] + cset[0] + str + cset[1] + cset[1] + str + cset[1] + cset[2]); if (c == i) { str += cset[0]; } else if (c == i+1) { str += cset[1]; } else { str += cset[2]; } } char last = getSingleChar(str); return str+last; }

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

combo.cpp: In function 'char getSingleChar(std::string)':
combo.cpp:6:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |  if (press(str+"AB") > str.size()) {
      |      ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:7:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |   if (press(str+"A") > str.size()) {
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |   if (press("X") > str.size()) {
      |       ~~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...