# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
499966 | Khizri | 콤보 (IOI18_combo) | C++17 | 57 ms | 720 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string x="ABXY";
bool ask(int l,int r,string ans){
string p="";
for(int i=l;i<=r;i++){
p+=ans;
p+=x[i];
}
//cout<<p<<endl;
if(press(p)>=ans.size()+1){
return true;
}
return false;
}
string guess_sequence(int n) {
string ans="";
for(int i=0;i<n;i++){
if(i==1){
for(int j=0;j<4;j++){
if(x[j]==ans[0]){
x.erase(x.begin()+j);
break;
}
}
}
int l=0,r=x.size()-1;
while(l<=r){
int m=(l+r)/2;
if(ask(l,m,ans)){
r=m-1;
}
else{
l=m+1;
}
}
ans+=x[r+1];
}
//cout<<ans<<endl;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |