Submission #430872

#TimeUsernameProblemLanguageResultExecution timeMemory
430872Belgutei콤보 (IOI18_combo)C++17
5 / 100
2 ms200 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define mk make_pair string p,tur; int coin; vector<char> v; std::string guess_sequence(int N) { // p='A'; coin=press(p); if(coin==0){ p='B'; coin=press(p); if(coin==0){ p='X'; coin=press(p); if(coin==0) p='Y'; } } char ch=p[0]; if(ch!='A') v.pb('A'); if(ch!='B') v.pb('B'); if(ch!='X') v.pb('X'); if(ch!='Y') v.pb('Y'); for(int i=2; i<N; i++){ tur=p+v[0]+p+v[1]+v[0]+p+v[1]+v[2]+p+v[1]+v[1]; coin=press(tur); if(coin==p.size()){ p+=v[2]; } else{ if(coin==p.size()+1){ p+=v[0]; } else{ if(coin==p.size()+2) p+=v[1]; } } } tur=p+v[0]+p+v[1]; coin=press(tur); if(coin==p.size()){ p+=v[2]; return p; } tur=p+v[0]; coin=press(tur); if(coin==p.size()){ p+=v[1]; return p; } else{ p+=v[0]; return p; } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:37:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |         if(coin==p.size()){
      |            ~~~~^~~~~~~~~~
combo.cpp:41:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |             if(coin==p.size()+1){
      |                ~~~~^~~~~~~~~~~~
combo.cpp:45:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |                 if(coin==p.size()+2) p+=v[1];
      |                    ~~~~^~~~~~~~~~~~
combo.cpp:51:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 |     if(coin==p.size()){
      |        ~~~~^~~~~~~~~~
combo.cpp:57:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |     if(coin==p.size()){
      |        ~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...