Submission #554831

# Submission time Handle Problem Language Result Execution time Memory
554831 2022-04-29T13:28:33 Z kevinxiehk Hotter Colder (IOI10_hottercolder) C++17
0 / 100
631 ms 151856 KB
#include <bits/stdc++.h>
#include "grader.h"
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
using namespace std;
 
int Guess (int x);
 
int HC(int n){
    int l = 1, r = n;
    int last = 1;
    Guess(1);
    while(l < r) {
        if(last != l && last != r) {
            Guess(l); last = l;
        }
        int k = Guess(l ^ r ^ last);
        last = l ^ r ^ last;
        if(k == 0) {
            return (l + r) / 2;
        }
        else if((k == 1 && r == last) || (k == 0 && l == last)) {
            l = (l + r) / 2 + 1;
        }
        else {
            r = (l + r + 1) / 2 - 1;
        }
    }
    return l;
}
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 13260 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 13208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 13260 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 631 ms 151856 KB Output isn't correct - alpha = 0.000000000000