Submission #109621

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1096212019-05-07 08:10:43polyfishCombo (IOI18_combo)C++14
97 / 100
48 ms568 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
char C[] = {'A', 'B', 'X', 'Y'};
string S;
bool find_first_two_char(int x) {
int tmp = press(string()+C[x]+C[x+1]+C[x]+C[x+1]);
if (tmp==0)
return false;
if (tmp==1) {
if (press(string()+C[x])==1)
S += C[x];
else
S += C[x+1];
if (press(S+C[(x+2)%4])==2)
S += C[(x+2)%4];
else
S += C[(x+3)%4];
}
else if (tmp==2) {
if (press(string()+C[x])==1)
S = S + C[x] + C[x+1];
else
S = S + C[x+1] + C[x];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:79:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   79 |     if (tmp<S.size()) {
      |         ~~~^~~~~~~~~
combo.cpp:83:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   83 |     else if (tmp==S.size()+1) {
      |              ~~~^~~~~~~~~~~~
combo.cpp:86:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |     else if (tmp==S.size()) {
      |              ~~~^~~~~~~~~~
combo.cpp:87:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   87 |         if (press(S+C[2])==S.size()+1)
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...