# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162332 | popovicirobert | The Big Prize (IOI17_prize) | C++14 | 137 ms | 508 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int find_best(int n) {
srand(time(NULL));
auto myrand = [&]() {
return (1LL * (1LL << 15) * rand() ^ rand()) % n;
};
vector <bool> vis(n);
int i, mx = 0;
for(i = 0; i < 15 && i < n; i++) {
int cur = myrand();
while(vis[cur]) {
cur = myrand();
}
vector <int> a = ask(cur);
mx = max(mx, a[0] + a[1]);
vis[cur] = 1;
}
int num = n - mx;
i = 0;
while(i < n) {
vector <int> a = ask(i);
if(a[0] + a[1] == 0) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |