답안 #386980

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
386980 2021-04-07T18:29:28 Z Carmel_Ab1 커다란 상품 (IOI17_prize) C++17
20 / 100
2 ms 492 KB
#include <bits/stdc++.h>
#include "prize.h"
//#include "grader.cpp"
using namespace std;
typedef long long ll;
typedef vector<ll>vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
typedef vector<int> vi;

#define all(x) x.begin(),x.end()
#define print(x) {for(auto it:x) cout << it << " " ;cout << "\n";}
#define out(x) {cout << x << "\n"; return;}
#define GLHF ios_base::sync_with_stdio(false); cin.tie(NULL)

int find_best(int n){
    int l=0,r=n-1,ans=-1;

    while(l<=r){
        int m=(l+r)/2;
        vi res=ask(m);
        if(!res[0] && !res[1])return m;
        if(res[0]){
            ans=m;
            r=m-1;
        }
        else
            l=m+1;
    }
    return ans;

}
/*
8
2 2 2 1 2 2 2 2
 */
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 2 ms 368 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 364 KB Output is correct
2 Correct 1 ms 492 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Incorrect 1 ms 364 KB answer is not correct
12 Halted 0 ms 0 KB -