제출 #1015251

#제출 시각아이디문제언어결과실행 시간메모리
1015251TroySer콤보 (IOI18_combo)C++17
10 / 100
52 ms936 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string currPerm = "ABXY"; char firsty; for (int i = 0; i < currPerm.size(); i++) { if (press(currPerm.substr(i,1)) == 1) { firsty = currPerm[i]; break; } } string currString = ""; currString += firsty; for (int i = 1; i < N; i++) { for (int i = 0; i < currPerm.size(); i++) { if (press(currString + currPerm[i]) == currString.size() + 1) { currString += currPerm[i]; break; } } } return currString; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   for (int i = 0; i < currPerm.size(); i++) {
      |                   ~~^~~~~~~~~~~~~~~~~
combo.cpp:18:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for (int i = 0; i < currPerm.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~~~~
combo.cpp:19:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |       if (press(currString + currPerm[i]) == currString.size() + 1) {
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...