Submission #592358

# Submission time Handle Problem Language Result Execution time Memory
592358 2022-07-09T05:33:48 Z ogibogi2004 Hotter Colder (IOI10_hottercolder) C++14
0 / 100
10000 ms 24416 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

int HC(int N)
{
    srand(69);
    Guess(1);
    int last=1,l=1,r=N;
    while(l<r)
    {
        int mid=rand()%(r-l+1)+l;
        int t=Guess(mid);
        int l1=N+1,r1=0;
        for(int j=l;j<=r;j++)
        {
            int dist1=abs(mid-j);
            int dist2=abs(last-j);
            if(t==0&&dist1==dist2)
            {
                l1=min(l1,j);
                r1=max(r1,j);
            }
            if(t==1&&dist1<dist2)
            {
                l1=min(l1,j);
                r1=max(r1,j);
            }
            if(t==-1&&dist1<dist2)
            {
                l1=min(l1,j);
                r1=max(r1,j);
            }
        }
        last=mid;
        l=l1;r=r1;
    }
    return l;
}
# Verdict Execution time Memory Grader output
1 Incorrect 482 ms 17624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 502 ms 17536 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 495 ms 17532 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 10020 ms 24416 KB Time limit exceeded