Submission #1062576

#TimeUsernameProblemLanguageResultExecution timeMemory
1062576Wasif_ShahzadCombo (IOI18_combo)C++17
10 / 100
43 ms1460 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

std::string guess_sequence(int N) {
  random_device rd;
  mt19937 g(rd());
  vector<char> moves = {'A', 'B', 'X', 'Y'};
  string ans;
  for(int i = 0; i < N; i++){
    shuffle(moves.begin(), moves.end(), g);
    for(char option: moves){
      string tmp = ans + option;
      int cur = press(tmp);
      if(cur == ans.size() + 1){
        ans = tmp;
        break;
      }
    }
  }      
  return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |       if(cur == ans.size() + 1){
      |          ~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...