Submission #851213

# Submission time Handle Problem Language Result Execution time Memory
851213 2023-09-18T21:04:08 Z Pajaraja Combo (IOI18_combo) C++17
0 / 100
1 ms 344 KB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
char c[4]={'A','B','X','Y'};
string guess_sequence(int N)
{
    int koji=0;
    string s1="XY",s2="BY";
    if(press(s1)) koji+=2;
    if(press(s2)) koji+=1;
    string s=""+c[koji];
    vector<char> ch;
    for(int i=0;i<4;i++) if(i!=koji) ch.push_back(c[i]);
    if(N==1) return s;
    for(int i=2;i<N;i++)
    {
        string t=s+ch[0]+s+ch[1]+ch[0]+s+ch[1]+ch[1]+s+ch[1]+ch[2];
        int x=press(t);
        if(x==i) s+=ch[2];
        if(x==i+1) s+=ch[0];
        if(x==i+2) s+=ch[1];
    }
    string t1=s+ch[0],t2=s+ch[1],t3=s+ch[2];
    if(press(t1)==N) return t1;
    if(press(t2)==N) return t2;
    return t3;
}
# 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 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -