Submission #1020813

#TimeUsernameProblemLanguageResultExecution timeMemory
1020813khomeCombo (IOI18_combo)C++17
10 / 100
57 ms920 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { vector<string> a; a={"A", "B", "X", "Y"}; // cout << N << "\n"; string res, per = ""; while (res.size()!=N){ for (string i : a){ if (per != i && press(res+i) == (res+i).size()){ // cout << press(res+i) << ' ' << res+i << "\n"; if (per == "") per = i; res += i; break; } } } // cout << res << "\n"; return res; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:22: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |     while (res.size()!=N){
      |            ~~~~~~~~~~^~~
combo.cpp:13:38: 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 (per != i && press(res+i) == (res+i).size()){
      |                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...