Submission #93010

#TimeUsernameProblemLanguageResultExecution timeMemory
93010beso123Combo (IOI18_combo)C++14
10 / 100
113 ms468 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string a="ABXY"; string pas="XAB"; /*int press(string s){ int r=0; string b=""; for(int k=0;k<pas.size();k++){ b=b+pas[k]; if(s.find(b)==-1) return r; r++; } return r; }*/ string guess_sequence(int N){ int r=1; string s=""; while(s.size()<N){ for(int k=0;k<a.size();k++){ string b=s+a[k]; if(press(b)==r){ s=b; r++; break; } } } return s; } /*int main(){ string s=guess_sequence(pas.size()); cout<<s; return 0; }*/

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:15: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 | while(s.size()<N){
      |       ~~~~~~~~^~
combo.cpp:22:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 | for(int k=0;k<a.size();k++){
      |             ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...