제출 #933348

#제출 시각아이디문제언어결과실행 시간메모리
933348Aria_lix19콤보 (IOI18_combo)C++14
0 / 100
0 ms344 KiB
#include <cstdio> #include <cstdlib> #include <algorithm> #include <string> #include <iostream> #include <cstring> #include <string> #include <vector> #include <math.h> #include <cmath> #include <iomanip> #include <queue> #include <cassert> #include <numeric> #include <map> #include <climits> #include <set> int press(std::string p); std::string guess_sequence(int N) { std::string p = "AB"; char a, b, c; // for (int i = 0; i < 4 * N; ++i) { // p += 'A'; // } int coins = press(p); std::string s = ""; // for (int i = 0; i < N; ++i) { // S += 'A'; // } // return S; if(coins ==0){ p='X'; if(coins==0){ s+='Y'; a='A'; b='B'; c='X'; } else{ s+='X'; a='A'; b='B'; c='Y'; } } else{ p='A'; if(coins==0){ s+='B'; a='A'; b='X'; c='Y'; } else{ s+='A'; a='B'; b='X'; c='Y'; } } for(int i = 1; i <N-1; i++){ p=s+a+s+b+a+s+b+b+s+b+c; coins=press(p); if(coins==s.size()){ s+=c; } else if(coins==s.size()+1){ s+=a; } else s+=b; } p=s+a+s+b; if(coins==s.size()+1){ p=s+a; if(coins==1) s+=a; else s+=b; } else s+=c; return s; }

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

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