| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 297127 | Muhammetali | The Big Prize (IOI17_prize) | C++11 | 1 ms | 256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
int find_best(int n)
{
queue<pi>q;
q.push({0,n-1});
while(sz(q))
{
int l=q.ft.f;
int r=q.ft.s;
int jem=q.ft.f-q.ft.s+1;
jem/=4;
l+=jem;r+=jem;
vi v1=ask(l);
vi v2=ask(r);
if (v1[0]==0 && v1[1]==0)return l;
if (v2[0]==0 && v2[1]==0)return r;
if (v1[0]-v2[0]==0)
{
q.push({q.ft.f,l-1});
q.push({r+1,q.ft.s});
}
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
