Submission #987031

# Submission time Handle Problem Language Result Execution time Memory
987031 2024-05-21T17:50:00 Z VMaksimoski008 The Big Prize (IOI17_prize) C++17
20 / 100
1 ms 600 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

pii query(int p) {
	vector<int> res = ask(p);
	return { res[0], res[1] };
}

int find_best(int n) {
	//one type 1
	//n-1 type 2

	int l=0, r=n-1, ans=0;
	while(l <= r) {
		int mid = (l + r) / 2;
		auto [a, b] = query(mid);
		
		if(a == 0 && b == 0) {
			ans = mid;
			break;
		}

		if(a > 0) r = mid - 1;
		else l = mid + 1;
	}

	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 424 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 404 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 596 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 540 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Incorrect 1 ms 344 KB answer is not correct
12 Halted 0 ms 0 KB -