# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
357658 | 2021-01-24T11:26:49 Z | mario05092929 | Colors (BOI20_colors) | C++11 | 1 ms | 364 KB |
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const int INF = 1e9; const int TMX = 1 << 18; const long long llINF = 1e16; const long long mod = 1e9+7; const long long hashmod = 100003; const int MAXN = 100000; const int MAXM = 1000000; typedef long long ll; typedef long double ld; typedef pair <int,int> pi; typedef pair <ll,ll> pl; typedef vector <int> vec; typedef vector <pi> vecpi; typedef long long ll; int n,x,l,r; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; l = 2, r = n,x = 1; for(int i = 1;i <= n;i++) { cout << "? " << x << endl; int val; cin >> val; if(i^1&&!val) { cout << "= " << n-i+2 << endl; return 0; } if(i % 2) x = r--; else x = l++; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (5 queries) |
2 | Correct | 1 ms | 364 KB | OK (6 queries) |
3 | Correct | 1 ms | 364 KB | OK (10 queries) |
4 | Incorrect | 1 ms | 364 KB | Unexpected end of file - token expected |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (5 queries) |
2 | Correct | 1 ms | 364 KB | OK (6 queries) |
3 | Correct | 1 ms | 364 KB | OK (10 queries) |
4 | Incorrect | 1 ms | 364 KB | Unexpected end of file - token expected |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (5 queries) |
2 | Correct | 1 ms | 364 KB | OK (6 queries) |
3 | Correct | 1 ms | 364 KB | OK (10 queries) |
4 | Incorrect | 1 ms | 364 KB | Unexpected end of file - token expected |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (5 queries) |
2 | Correct | 1 ms | 364 KB | OK (6 queries) |
3 | Correct | 1 ms | 364 KB | OK (10 queries) |
4 | Incorrect | 1 ms | 364 KB | Unexpected end of file - token expected |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (5 queries) |
2 | Correct | 1 ms | 364 KB | OK (6 queries) |
3 | Correct | 1 ms | 364 KB | OK (10 queries) |
4 | Incorrect | 1 ms | 364 KB | Unexpected end of file - token expected |
5 | Halted | 0 ms | 0 KB | - |