Submission #962594

# Submission time Handle Problem Language Result Execution time Memory
962594 2024-04-14T00:12:37 Z Mohamed_Kachef06 Combo (IOI18_combo) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
#include "combo.h"
//#include "grader.cpp"
using namespace std;

string guess_sequence(signed N){
    char a[] = {'A' , 'B' , 'X' , 'Y'};
    string s;
    if (s.empty()) for (int i = 0 ; i < 4 ; i++) {if (press(s+a[i])) {s+=a[i]; break;}};
    for (int i = 0 ; i < N-1 ; i++){
      random_shuffle(a , a+4); 
      if (a[i] != s[0]) if (press(s+a[i]) > s.size()) {s+=a[i]; break;} 
    }
    return s; 
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |       if (a[i] != s[0]) if (press(s+a[i]) > s.size()) {s+=a[i]; break;}
      |                             ~~~~~~~~~~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Partially correct 1 ms 344 KB Output is partially correct
5 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
6 Halted 0 ms 0 KB -