Submission #1071647

#TimeUsernameProblemLanguageResultExecution timeMemory
1071647RigobertusCombo (IOI18_combo)C++17
10 / 100
63 ms1112 KiB
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <set> #include <queue> #include <string> //#define int long long #include "combo.h" using namespace std; string guess_sequence(int n) { string c[4] = { "A", "B", "X", "Y"}; string s = ""; for (int i=0; i<n; i++) while (s.size() < n) { for (int i = 0; i < 4; i++) { string p = s + c[i]; if (press(p) == p.size()) { s = p; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |     while (s.size() < n) {
      |            ~~~~~~~~~^~~
combo.cpp:19:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |             if (press(p) == p.size()) {
      |                 ~~~~~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...