Submission #1062393

# Submission time Handle Problem Language Result Execution time Memory
1062393 2024-08-17T05:54:20 Z Muhammad_Aneeq The Big Prize (IOI17_prize) C++17
90 / 100
66 ms 6052 KB
#include "prize.h"
#include <vector>
#include <iostream>
#include <random>
using namespace std;
int const N=2e5+10;
bool vis[N]={};
vector<int>val[N];
vector<int> qu(int i)
{
	if (vis[i])
		return val[i];
	vis[i]=1;
	val[i]=ask(i);
	return val[i];
}
int find_best(int n)
{
	srand(time(0));
	int mx=0;
	for (int i=0;i<min(n,1500);i++)
	{
		int x=rand()%n;
		if (vis[x])
		{
			i--;
			continue;
		}
		vector<int>g=qu(x);
		if (g[0]+g[1]>mx)
			mx=g[0]+g[1];
		if (g[0]+g[1]==0)
			return x;
	}
	int st=0;
	while (1)
	{
		vector<int>g=qu(st);
		if (g[0]==0&&g[1]==0)
			break;
		if (g[0]+g[1]>=mx)
		{
			int en=n;
          	mx=g[0]+g[1];
			while (st+1<en)
			{
				int mid=(st+en)/2;
				if (mid<n&&qu(mid)==g)
					st=mid;
				else
					en=mid;
			}
		}
		st++;
	}
	return st;
}
# Verdict Execution time Memory Grader output
1 Correct 12 ms 5208 KB Output is correct
2 Correct 11 ms 5488 KB Output is correct
3 Correct 8 ms 5208 KB Output is correct
4 Correct 8 ms 5208 KB Output is correct
5 Correct 8 ms 5296 KB Output is correct
6 Correct 9 ms 5464 KB Output is correct
7 Correct 6 ms 5208 KB Output is correct
8 Correct 11 ms 5208 KB Output is correct
9 Correct 12 ms 5316 KB Output is correct
10 Correct 8 ms 5208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 5204 KB Output is correct
2 Correct 11 ms 5208 KB Output is correct
3 Correct 10 ms 5208 KB Output is correct
4 Correct 6 ms 5208 KB Output is correct
5 Correct 7 ms 5208 KB Output is correct
6 Correct 8 ms 5352 KB Output is correct
7 Correct 6 ms 5208 KB Output is correct
8 Correct 8 ms 5208 KB Output is correct
9 Correct 7 ms 5208 KB Output is correct
10 Correct 6 ms 5208 KB Output is correct
11 Correct 11 ms 5464 KB Output is correct
12 Correct 8 ms 5208 KB Output is correct
13 Correct 13 ms 5480 KB Output is correct
14 Correct 11 ms 5208 KB Output is correct
15 Correct 11 ms 5476 KB Output is correct
16 Partially correct 45 ms 5956 KB Partially correct - number of queries: 8189
17 Correct 8 ms 5208 KB Output is correct
18 Partially correct 55 ms 5692 KB Partially correct - number of queries: 9335
19 Correct 8 ms 5208 KB Output is correct
20 Correct 23 ms 5292 KB Output is correct
21 Correct 23 ms 5344 KB Output is correct
22 Correct 15 ms 5208 KB Output is correct
23 Correct 6 ms 5328 KB Output is correct
24 Correct 6 ms 5208 KB Output is correct
25 Partially correct 31 ms 5644 KB Partially correct - number of queries: 5922
26 Partially correct 26 ms 5464 KB Partially correct - number of queries: 5846
27 Correct 9 ms 5464 KB Output is correct
28 Partially correct 51 ms 5696 KB Partially correct - number of queries: 8865
29 Partially correct 49 ms 5664 KB Partially correct - number of queries: 7096
30 Partially correct 66 ms 5560 KB Partially correct - number of queries: 9293
31 Correct 8 ms 5208 KB Output is correct
32 Correct 13 ms 5464 KB Output is correct
33 Correct 2 ms 4952 KB Output is correct
34 Correct 21 ms 5656 KB Output is correct
35 Correct 12 ms 5456 KB Output is correct
36 Correct 13 ms 5604 KB Output is correct
37 Correct 12 ms 5348 KB Output is correct
38 Correct 7 ms 5208 KB Output is correct
39 Partially correct 40 ms 5456 KB Partially correct - number of queries: 5161
40 Partially correct 54 ms 5456 KB Partially correct - number of queries: 8181
41 Partially correct 44 ms 5888 KB Partially correct - number of queries: 6199
42 Partially correct 43 ms 5612 KB Partially correct - number of queries: 6199
43 Partially correct 31 ms 5640 KB Partially correct - number of queries: 5731
44 Correct 23 ms 5392 KB Output is correct
45 Correct 14 ms 5464 KB Output is correct
46 Correct 7 ms 5208 KB Output is correct
47 Partially correct 29 ms 5592 KB Partially correct - number of queries: 5319
48 Partially correct 40 ms 5456 KB Partially correct - number of queries: 7302
49 Correct 8 ms 5208 KB Output is correct
50 Partially correct 34 ms 5460 KB Partially correct - number of queries: 9324
51 Correct 31 ms 5852 KB Output is correct
52 Correct 9 ms 5208 KB Output is correct
53 Correct 9 ms 5464 KB Output is correct
54 Correct 27 ms 5456 KB Output is correct
55 Correct 6 ms 5208 KB Output is correct
56 Partially correct 51 ms 5656 KB Partially correct - number of queries: 9340
57 Partially correct 28 ms 5464 KB Partially correct - number of queries: 7226
58 Partially correct 40 ms 5456 KB Partially correct - number of queries: 7295
59 Partially correct 44 ms 5656 KB Partially correct - number of queries: 6195
60 Partially correct 28 ms 5456 KB Partially correct - number of queries: 5853
61 Correct 9 ms 5208 KB Output is correct
62 Correct 10 ms 5492 KB Output is correct
63 Correct 10 ms 5208 KB Output is correct
64 Correct 8 ms 5208 KB Output is correct
65 Correct 8 ms 5208 KB Output is correct
66 Correct 9 ms 5596 KB Output is correct
67 Correct 12 ms 5464 KB Output is correct
68 Correct 8 ms 5208 KB Output is correct
69 Correct 7 ms 5332 KB Output is correct
70 Correct 6 ms 5464 KB Output is correct
71 Partially correct 48 ms 5712 KB Partially correct - number of queries: 9305
72 Correct 12 ms 5464 KB Output is correct
73 Partially correct 66 ms 5576 KB Partially correct - number of queries: 9193
74 Partially correct 49 ms 5712 KB Partially correct - number of queries: 9244
75 Correct 9 ms 5456 KB Output is correct
76 Partially correct 36 ms 5992 KB Partially correct - number of queries: 8124
77 Partially correct 46 ms 5972 KB Partially correct - number of queries: 9457
78 Correct 10 ms 5464 KB Output is correct
79 Partially correct 28 ms 5464 KB Partially correct - number of queries: 5045
80 Partially correct 58 ms 5456 KB Partially correct - number of queries: 9434
81 Partially correct 55 ms 5608 KB Partially correct - number of queries: 9455
82 Partially correct 56 ms 5664 KB Partially correct - number of queries: 9384
83 Correct 8 ms 5208 KB Output is correct
84 Partially correct 30 ms 5532 KB Partially correct - number of queries: 7974
85 Partially correct 63 ms 6052 KB Partially correct - number of queries: 9454
86 Partially correct 42 ms 5680 KB Partially correct - number of queries: 6833
87 Correct 7 ms 5352 KB Output is correct
88 Partially correct 44 ms 5464 KB Partially correct - number of queries: 7846
89 Partially correct 25 ms 5660 KB Partially correct - number of queries: 6360
90 Correct 8 ms 5208 KB Output is correct
91 Correct 16 ms 5208 KB Output is correct
92 Correct 25 ms 5584 KB Output is correct
93 Partially correct 65 ms 5768 KB Partially correct - number of queries: 8556
94 Partially correct 59 ms 5364 KB Partially correct - number of queries: 8836
95 Partially correct 46 ms 5712 KB Partially correct - number of queries: 8822
96 Partially correct 49 ms 5904 KB Partially correct - number of queries: 8751
97 Partially correct 44 ms 5524 KB Partially correct - number of queries: 8108