# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1033221 |
2024-07-24T14:27:07 Z |
ZeroCool |
Colors (BOI20_colors) |
C++14 |
|
0 ms |
344 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ar array
#define ld long double
const int N = 3e5 + 20;
const int B = 400;
const int M = 200;
const int INF = 1e15;
const int LOG = 24;
const int MOD = 998244353;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,bmi,bmi2,lzcnt,popcnt")
bool query(int x){
++x;
int res;
cout<<"P 1"<<endl;
cin>>res;
cout<<"P "<<x<<endl;
cin>>res;
return res;
}
signed main(){ios_base::sync_with_stdio(false);cin.tie(0);
int n;
cin>>n;
int lo = 1;
int hi = n - 1;
int ans = n;
while(lo <= hi){
int mid = (lo + hi) / 2;
if(query(mid)){
hi = mid - 1;
ans = mid;
}else lo = mid + 1;
}
cout<<"= "<<ans<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |