# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
922012 | owoovo | Colors (BOI20_colors) | C++14 | 0 ms | 436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC opimize("unroll-loops,O3")
#pragma GCC target("avx2")
#define int long long
#define F first
#define S second
using namespace std;
vector<int> use;
int query(int pos){
cout<<"? "<<pos<<endl;
int a;
cin>>a;
return a;
}
signed main(){
int l=1,r;
cin>>r;
while(l!=r){
int m=(l+r)/2;
use.push_back(m);
l=m+1;
}
int b=1,mn=0,npos=0;
for(auto x:use){
npos+=x*(2*b-1);
cout<<npos<<"\n";
mn=min(mn,npos);
b^=1;
}
mn=abs(mn)+1;
query(mn);
b=1;
l=1;
npos=mn;
while(l!=r){
int m=(l+r-1)/2;
npos+=m*(2*b-1);
b^=1;
if(query(npos)){
r=m;
}else{
l=m+1;
}
}
cout<<"= "<<l<<endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |