이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#pragma GCC optimize ("Ofast")
//#pragma GCC target ("avx,avx2")
//#pragma GCC optimize ("trapv")
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
/*
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cin.exceptions(cin.failbit);
#define rep(i, a, b) for(lli i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (lli)(x).size()
#define what_is(x) cerr << #x << " is " << x << endl;
#define wis cout<<endl<<"I already speak english, bitch"<<endl<<endl;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef pair<ii,lli> iii;
#define trace(args...) { string _s =#args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string> it){}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args){
cout << *it << " : " << a << endl;
err(++it, args...);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class compare>
using ordered_set = tree<T, null_type, compare, rb_tree_tag, tree_order_statistics_node_update>;
//usage: ordered_set< el tipo , el comparador> nombre;
*/
string guess_sequence(int n){
string wyn;
vector<char> let={'A','B','X','Y'};
char ban;
for(auto x : let){
string hol;hol+=x;
if(press(hol)){
ban=x;
break;
}
}
wyn+=ban;
int len=1;
for(int i=1;i<n;i++){
for(auto x : let){
if(x==ban) continue;
if(press(wyn+x)==len+1){
wyn+=x;
len++;
break;
}
}
}
return wyn;
}
/*
int main(){
string s;
s+='a';
cout<<s<<endl;
return 0;
}
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |