답안 #283847

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
283847 2020-08-26T08:01:14 Z balbit 커다란 상품 (IOI17_prize) C++14
20 / 100
1 ms 384 KB
#include <bits/stdc++.h>
#ifndef BALBIT
#include "prize.h"
#endif
using namespace std;

#define ll long long
#define pii pair<int, int>
#define f first
#define s second

#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())
#define pb push_back

#ifdef BALBIT
#define bug(...) cerr<<"#"<<__LINE__<<" "<<#__VA_ARGS__<<": ", _do(__VA_ARGS__)
template <typename T> void _do(T && x) {cerr<<x<<endl;}
template <typename T, typename ...S> void _do(T && x, S&&...y) {cerr<<x<<", "; _do(y...);}
#define IOS()
#else
#define bug(...)
#define IOS() ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#endif


int find_best(int n) {
	int l = 0, r = n-1;
	while (l!=r) {
		int mid = (l+r)/2;
		vector<int> x = ask(mid);
		if (x[0] == 0 && x[1] == 0) return mid;
		if (x[1]) l = mid+1;
		else r = mid-1;
	}
	return l;
}

#ifdef BALBIT
signed main(){
	IOS();
	bug(1,2);


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