Submission #344931

# Submission time Handle Problem Language Result Execution time Memory
344931 2021-01-06T19:03:57 Z Alma Combo (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include <iostream>
#include <vector>
#include <string>
#include <combo.h>
using namespace std;

string guess_sequence(int N) {
    string S = "";
    vector<char> buttons = {'A', 'B', 'X', 'Y'};

    for (int i = 0; i < buttons.size(); i++) {
        if (press(S + buttons[i]) == 1) {
            S += buttons[i];
            buttons.erase(buttons.begin()+i);
        }
    }    
    for (int i = 2; i <= N; i++) {
        for (int j = 0; j < buttons.size(); j++) {
            if (press(S + buttons[j]) == i) {S += buttons[j];}
        }
    }
    return S;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int i = 0; i < buttons.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~~~
combo.cpp:18:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |         for (int j = 0; j < buttons.size(); j++) {
      |                         ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -