Submission #677057

#TimeUsernameProblemLanguageResultExecution timeMemory
677057ToxtaqCombo (IOI18_combo)C++17
10 / 100
55 ms572 KiB
#include<bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int N){ string s; char fchar; if(press("A") == 1)fchar = 'A'; else if(press("B") == 1)fchar = 'B'; else if(press("X") == 1)fchar = 'X'; else fchar = 'Y'; s += fchar; for(int i = 1;i < N;++i){ if(fchar != 'A' && press(s + 'A') == s.length() + 1)s += 'A'; else if(fchar != 'B' && press(s + 'B') == s.length() + 1)s += 'B'; else if(fchar != 'X' && press(s + 'X') == s.length() + 1)s += 'X'; else if(fchar != 'Y' && press(s + 'Y') == s.length() + 1)s += 'Y'; } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         if(fchar != 'A' && press(s + 'A') == s.length() + 1)s += 'A';
      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
combo.cpp:14:48: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         else if(fchar != 'B' && press(s + 'B') == s.length() + 1)s += 'B';
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
combo.cpp:15:48: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         else if(fchar != 'X' && press(s + 'X') == s.length() + 1)s += 'X';
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
combo.cpp:16:48: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         else if(fchar != 'Y' && press(s + 'Y') == s.length() + 1)s += 'Y';
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...