제출 #993855

#제출 시각아이디문제언어결과실행 시간메모리
993855voi콤보 (IOI18_combo)C++17
100 / 100
23 ms2140 KiB
#include <bits/stdc++.h> #ifndef TANH #include "combo.h" #endif // TANH using namespace std; typedef long long ll; const int ar = 2e5+2; const ll mod = 1e9+7; const int oo = 1e9; #ifdef TANH int main() {} bool press(string a) {} #endif // TANH string guess_sequence(int n) { string s = "", t; if(press("AB")) { if(press("A")) s += 'A', t = "BXY"; else s += 'B', t = "AXY"; } else { if(press("X")) s += 'X', t = "ABY"; else s += 'Y', t = "ABX"; } if(s.size() == n) return s; for(int i = 1; i < n - 1; ++i) { string p = ""; p += s + t[0]; p += s + t[1] + t[0]; p += s + t[1] + t[1]; p += s + t[1] + t[2]; int x = press(p) - s.size(); if(x == 0) s += t[2]; else if(x == 1) s += t[0]; else s += t[1]; } if(press(s + t[0]) == n) s += t[0]; else if(press(s + t[1]) == n) s += t[1]; else s += t[2]; return s; }

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

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