Submission #572098

# Submission time Handle Problem Language Result Execution time Memory
572098 2022-06-03T16:02:06 Z srlabib Combo (IOI18_combo) C++17
0 / 100
1 ms 208 KB
#include<bits/stdc++.h>
#include"combo.h"
using namespace std;
string guess_sequence(int n)
{
    string a = {'A','B','X','Y'};
    
    string ans,gues = "a";
    char ff = 'z';
    int l = 0,c = 0;
    for(int i  = 0; i<n; i++){
        for(int j = 0; j<4; j++)
        {
            //if(a[j]==ff)continue;
            gues[i] = a[j];
            c = press(gues);
           
            if(c>l){
                ans.push_back(a[j]);
                gues.push_back('a');
                l = c;
                continue;
            }
        }
    }

    return ans;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:10: warning: unused variable 'ff' [-Wunused-variable]
    9 |     char ff = 'z';
      |          ^~
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 208 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 208 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -