제출 #1062374

#제출 시각아이디문제언어결과실행 시간메모리
1062374Sir_Ahmed_Imran커다란 상품 (IOI17_prize)C++17
20 / 100
59 ms428 KiB
                                    ///~~~LOTA~~~///
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define MAXN 200000
int find_best(int n){
    int m,o;
    srand(time(0));
    vector<int> a;
    for(int i=m=0;i<100;i++){
        a=ask(rand()%n);
        m=max(m,a[0]+a[1]);
    }
    o=0;
    while(o<n){
        a=ask(o);
        if(!a[0] && !a[1])
            return o;
        if(a[0]+a[1]==m){
            for(int i=131072;i>0;i/=2)
                if(o+i<n && ask(o+i)==a)
                    o+=i;
        }
        o++;
    }
    return o;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...