Submission #331933

# Submission time Handle Problem Language Result Execution time Memory
331933 2020-11-30T18:40:06 Z Yomapeed Combo (IOI18_combo) C++17
0 / 100
1 ms 200 KB
#include<bits/stdc++.h>
#define pi 3.141592653589793238
#include "combo.h"
#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mt make_tuple 
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
 
 
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
string guess_sequence(int n){
    int i;
    string ans = "";
    vector<char> c = {'A', 'B', 'X', 'Y'};
    if(press("A") == 1){
        ans += 'A';
        c.erase(c.begin());
    }
    else if(press("B") == 1){
        ans += 'B';
        c.erase(c.begin() + 1);
    }
    else if(press("X") == 1){
        ans += 'X';
        c.erase(c.begin() + 2);
    }
    else{
        ans += 'Y';
        c.erase(c.begin() + 3);
    }
    for(i = 1; i < n; i++){
        string a, b, c, d;
        a = ans + c[0];
        b = ans + c[1] + c[1];
        c = ans + c[1] + c[2];
        d = ans + c[1] + c[0];
        ll val = press(a + b + c + d) - i;
        if(val == 1){
            ans += c[0];
        }
        else if(val == 2){
            ans += c[1];
        }
        else{
            ans += c[2];
        }
    }
    return ans;
} 
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: invalid press
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Incorrect 0 ms 200 KB Wrong Answer: invalid press
6 Halted 0 ms 0 KB -