Submission #1009752

# Submission time Handle Problem Language Result Execution time Memory
1009752 2024-06-28T03:15:52 Z u_suck_o Hotter Colder (IOI10_hottercolder) C++17
0 / 100
444 ms 58180 KB
#include "bits/stdc++.h"
#include "grader.h"

using namespace std;

int Guess(int G);

int f(int l, int r) {
    if (l == r)
        return l;
    
    int g1 = Guess(l);
    int g2 = Guess(r);
    
    if (r - l == 1) {
        if (g2 == -1)
            return l;
        else
            return r;
    }
    
    if (g2 == 0)
        return (l+r)/2;
    if (g2 == -1) {
        if ((l + r) % 2 == 1)
            return f(l, (l+r)/2-1);
        else
            return f(l, (l+r)/2);
    }
    else {
        if ((l+r) % 2 == 1)
            return f((l+r)/2, r);
        else
            return f((l+r)/2+1, r);
    }
}
int HC(int N){
    return f(1, N);
}

Compilation message

hottercolder.cpp: In function 'int f(int, int)':
hottercolder.cpp:12:9: warning: unused variable 'g1' [-Wunused-variable]
   12 |     int g1 = Guess(l);
      |         ^~
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 5468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 5468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 5468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 444 ms 58180 KB Output isn't correct - alpha = 0.000000000000
2 Halted 0 ms 0 KB -