Submission #283847

# Submission time Handle Problem Language Result Execution time Memory
283847 2020-08-26T08:01:14 Z balbit The Big Prize (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
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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 -