제출 #313693

#제출 시각아이디문제언어결과실행 시간메모리
313693Jarif_Rahman콤보 (IOI18_combo)C++17
10 / 100
119 ms472 KiB
#include "combo.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; str guess_sequence(int n){ str s = ""; int r = 0; while(s.size() < n){ int sz = n - s.size(); int ab = press(s+str(sz, 'A') + s+str(sz, 'B')); int xy = press(s+str(sz, 'X') + s+str(sz, 'Y')); if(ab > r){ int a = press(s+str(sz, 'A')); if(a > r){ r = a; s = (s+str(sz, 'A')).substr(0, r); } else{ r = ab; s = (s+str(sz, 'B')).substr(0, r); } } else{ int x = press(s+str(sz, 'X')); if(x > r){ r = x; s = (s+str(sz, 'X')).substr(0, r); } else{ r = xy; s = (s+str(sz, 'Y')).substr(0, r); } } } return s; }

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

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