Submission #754502

# Submission time Handle Problem Language Result Execution time Memory
754502 2023-06-07T22:13:32 Z ValiAntonie Hotter Colder (IOI10_hottercolder) C++14
25 / 100
529 ms 8100 KB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;


int HC(int n){
    int st = 1;
    int dr = n;
    Guess(1);
    int x = Guess(n);
    int prev = -1;
    while(st <= dr){
        int mij = (st + dr) >> 1;
        if(x == 0)
            return mij;
        else if(x > 0){
            st = mij + 1;
            if(prev == 0){
            x = Guess(st);
            x = -x;
            if(x == -1){
                x = Guess(dr);
                prev = 0;
            }
            }
            else{
            Guess(st);
            x = Guess(dr);
            }
            prev = 1;
        }
        else{
            dr = mij;
            Guess(st);
            x = Guess(dr);
            prev = 0;
        }
    }
    return st;
}
# Verdict Execution time Memory Grader output
1 Correct 20 ms 1236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 1300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 1300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 529 ms 8100 KB Output isn't correct - alpha = 0.000000000000