# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
442665 | Theo830 | 콤보 (IOI18_combo) | C++17 | 52 ms | 572 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
typedef long long ll;
ll INF = 1e18+7;
long long MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(long long i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<endl;
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
const long long N = 1e6+5;
void YESNO(ll a){if(!!a){pl("Yes");}else{pl("No");}}
void filesin(void){freopen("tracing.in","r",stdin);}
void filesout(void){freopen("tracing.out","w",stdout);}
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Training
string guess_sequence(int N){
int n = N;
string ans = "";
string other = "";
string all = "ABXY";
if(press("AB")){
if(press("A")){
ans += "A";
}
else{
ans += "B";
}
}
else{
if(press("X")){
ans += "X";
}
else{
ans += "Y";
}
}
if(n == 1){
return ans;
}
for(auto x:all){
if(ans[0] != x){
other += x;
}
}
while(ans.size() < n-1){
int val = press(ans+other[0]+ans+other[1]+other[0]+ans+other[1]+other[1]+ans+other[1]+other[2]);
if(val == ans.size()+2){
ans += other[1];
}
else if(val == ans.size()+1){
ans += other[0];
}
else{
ans += other[2];
}
}
if(press(ans+other[0]) == n){
ans += other[0];
}
else if(press(ans + other[1]) == n){
ans += other[1];
}
else{
ans += other[2];
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |