제출 #769289

#제출 시각아이디문제언어결과실행 시간메모리
769289Mery2005콤보 (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include <iostream> #include <algorithm> #include <queue> #include <cmath> #include <vector> #include <list> #include <string> #include <unordered_map> #include <map> #include <set> #include <stack> #include <string> #include <iomanip> #include <fstream> using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(0); } const long long mod = 1e9+7; const int N = 3e6+5; int a[N] , dp[N]; string guess_sequence(int N){ string t; char x[4]; if(press("A")){ t = "A"; x[0] = 'B'; x[1] = 'X'; x[2] = 'Y'; } if(press("B")){ t = "B"; x[0] = 'A'; x[1] = 'X'; x[2] = 'Y'; } if(press("X")){ t = "X"; x[0] = 'B'; x[1] = 'A'; x[2] = 'Y'; } if(press("Y")){ t = "Y"; x[0] = 'B'; x[1] = 'X'; x[2] = 'A'; } string s = t; for(int i = 0 ; i < (N - 2) ; i++){ int ans = press(s + x[0] + x[0] + s + x[0] + x[1] + s + x[0] + x[2] + s + x[1] + s); if(ans == s.size()){ s += x[2]; } else if(ans == (s.size() + 1)){ s += x[1]; } else{ s += x[0]; } } int num = press(s + x[0] + s + x[1]); if (num == N){ num = press(s + x[0]); if (num == N){ return (s + x[0]); } else{ return (s + x[1]); } } else{ return (s + x[2]); } } // int main() { // return 0; // }

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

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