Submission #799635

# Submission time Handle Problem Language Result Execution time Memory
799635 2023-07-31T17:20:24 Z Liudas Hotter Colder (IOI10_hottercolder) C++17
50 / 100
479 ms 8200 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int N){
    int l = 1, r = N;
    int op = 1;
    while(l < r){
        int mid = (l + r) / 2;
        Guess(l);
        int t = Guess(r);
        //cout << l << " " << r  << " " << mid << " " << t << endl;
        if(t == 1){
            l = mid + 1;
        }
        if(t == -1){
            r = mid;
        }
        if(t == 0){
            //cout << "WTF" << endl;
            return mid;
        }
    }
    return l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:6:9: warning: unused variable 'op' [-Wunused-variable]
    6 |     int op = 1;
      |         ^~
# Verdict Execution time Memory Grader output
1 Correct 21 ms 1236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 1300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 1296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 479 ms 8200 KB Output isn't correct - alpha = 0.000000000000