Submission #413293

#TimeUsernameProblemLanguageResultExecution timeMemory
413293Ruxandra985Colors (BOI20_colors)C++14
0 / 100
2 ms200 KiB
#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 (stderr)

Colors.cpp: In function 'int main()':
Colors.cpp:9:19: warning: unused variable 'c' [-Wunused-variable]
    9 |     long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir;
      |                   ^
Colors.cpp:9:33: warning: unused variable 'sol' [-Wunused-variable]
    9 |     long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir;
      |                                 ^~~
Colors.cpp:9:43: warning: unused variable 'eq' [-Wunused-variable]
    9 |     long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir;
      |                                           ^~
Colors.cpp:9:48: warning: unused variable 'p2' [-Wunused-variable]
    9 |     long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir;
      |                                                ^~
Colors.cpp:9:69: warning: variable 'dir' set but not used [-Wunused-but-set-variable]
    9 |     long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir;
      |                                                                     ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...