Submission #497989

#TimeUsernameProblemLanguageResultExecution timeMemory
497989IOI_champion_in_1980Combo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<bits/stdc++.h> using namespace std; int a, b, c, d, e, n, m; string s, t, st; int press(string p); string guess_sequence(int n) { st="ABXY"; for (a=0; a<st.length(); a++) { string p=""; p=p+st[a]; p=p+st[a]; if (press(p)) { for (b=0; b<st.length(); b++) { if (b==a) continue; string h=""; h=h+st[a]; for (c=0; c<st.length(); c++) { if (c==a) continue; h=h+st[b]; h=h+st[c]; if (press(h)==3) return h; } } } } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for (a=0; a<st.length(); a++)
      |            ~^~~~~~~~~~~~
combo.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |    for (b=0; b<st.length(); b++)
      |              ~^~~~~~~~~~~~
combo.cpp:21:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for (c=0; c<st.length(); c++)
      |               ~^~~~~~~~~~~~
combo.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...