# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
413293 | 2021-05-28T12:56:09 Z | Ruxandra985 | Colors (BOI20_colors) | C++14 | 2 ms | 200 KB |
#include <bits/stdc++.h> using namespace std; int main() { //FILE *fin = fopen ("a.in" , "r"); long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir; //fscanf (fin,"%lld%lld",&n,&c); cin >> n; cout << "? " << 1; cin >> x; cout << endl; now = 1; st = 1; dr = n - 1; dir = 0; while (st <= dr){ mid = (st + dr)/2; now += mid; cout << "? " << now; cin >> x; cout << endl; now = 1; cout << "? " << 1; cin >> x; cout << endl; if (x) dr = mid - 1; else st = mid + 1; } cout << "= " << st << endl; /* eq = -1; sol = n; for (p2 = 62 ; p2 >= 0 ; p2--){ if ((1LL << p2) <= n){ /// vezi daca merge p2, daca merge add la C, altfel nu if (now + sol - (1LL << p2) <= n){ cout << "? " << now + sol - (1LL << p2); cin >> x; cout << endl; now = now + sol - (1LL << p2); if (x) sol -= (1LL << p2); } else if (now - sol + (1LL << p2) > 0){ cout << "? " << now - sol + (1LL << p2); cin >> x; cout << endl; now = now - sol + (1LL << p2); if (x) sol -= (1LL << p2); } else cout << "nu"; } } cout << "= " << sol - 1 << endl;*/ return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 200 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 200 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 200 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 200 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 200 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |