답안 #1062377

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1062377 2024-08-17T05:17:28 Z Sir_Ahmed_Imran 커다란 상품 (IOI17_prize) C++17
90 / 100
57 ms 5748 KB
                                    ///~~~LOTA~~~///
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define MAXN 200000
vector<int> a[MAXN];
vector<int> get(int x){
    if(a[x].empty())
        a[x]=ask(x);
    return a[x];
}
int find_best(int n){
    int m,o;
    srand(time(0));
    vector<int> a;
    for(int i=m=0;i<500;i++){
        a=get(rand()%n);
        m=max(m,a[0]+a[1]);
    }
    o=0;
    while(o<n){
        a=get(o);
        if(!a[0] && !a[1])
            return o;
        if(a[0]+a[1]==m){
            for(int i=131072;i>0;i/=2){
                if(o+i<n && get(o+i)==a)
                    o+=i;
            }
        }
        o++;
    }
    return o;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 4 ms 5380 KB Output is correct
4 Correct 3 ms 4952 KB Output is correct
5 Correct 4 ms 4952 KB Output is correct
6 Correct 3 ms 4952 KB Output is correct
7 Correct 4 ms 4952 KB Output is correct
8 Correct 3 ms 4952 KB Output is correct
9 Correct 4 ms 4952 KB Output is correct
10 Correct 4 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4952 KB Output is correct
2 Correct 5 ms 4952 KB Output is correct
3 Correct 5 ms 4952 KB Output is correct
4 Correct 5 ms 4952 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 6 ms 4952 KB Output is correct
7 Correct 4 ms 4952 KB Output is correct
8 Correct 3 ms 4952 KB Output is correct
9 Correct 4 ms 4952 KB Output is correct
10 Correct 3 ms 4952 KB Output is correct
11 Correct 4 ms 4952 KB Output is correct
12 Correct 4 ms 4952 KB Output is correct
13 Correct 6 ms 5164 KB Output is correct
14 Correct 4 ms 4952 KB Output is correct
15 Correct 8 ms 4952 KB Output is correct
16 Partially correct 57 ms 5660 KB Partially correct - number of queries: 7383
17 Correct 3 ms 4952 KB Output is correct
18 Partially correct 48 ms 5528 KB Partially correct - number of queries: 8532
19 Correct 3 ms 4952 KB Output is correct
20 Correct 13 ms 5208 KB Output is correct
21 Correct 16 ms 5164 KB Output is correct
22 Correct 4 ms 4952 KB Output is correct
23 Correct 3 ms 4952 KB Output is correct
24 Correct 4 ms 4952 KB Output is correct
25 Partially correct 25 ms 5208 KB Partially correct - number of queries: 5025
26 Correct 22 ms 5200 KB Output is correct
27 Correct 4 ms 4952 KB Output is correct
28 Partially correct 46 ms 5192 KB Partially correct - number of queries: 8085
29 Partially correct 32 ms 5452 KB Partially correct - number of queries: 6253
30 Partially correct 52 ms 5380 KB Partially correct - number of queries: 8333
31 Correct 4 ms 4952 KB Output is correct
32 Correct 5 ms 4952 KB Output is correct
33 Correct 2 ms 4952 KB Output is correct
34 Correct 16 ms 5144 KB Output is correct
35 Correct 4 ms 4952 KB Output is correct
36 Correct 10 ms 4952 KB Output is correct
37 Correct 4 ms 4952 KB Output is correct
38 Correct 4 ms 4952 KB Output is correct
39 Correct 18 ms 5140 KB Output is correct
40 Partially correct 38 ms 5204 KB Partially correct - number of queries: 7218
41 Partially correct 24 ms 5464 KB Partially correct - number of queries: 5488
42 Partially correct 39 ms 5200 KB Partially correct - number of queries: 5500
43 Partially correct 15 ms 5204 KB Partially correct - number of queries: 5003
44 Correct 15 ms 5208 KB Output is correct
45 Correct 17 ms 5152 KB Output is correct
46 Correct 3 ms 4952 KB Output is correct
47 Correct 21 ms 5208 KB Output is correct
48 Partially correct 38 ms 5208 KB Partially correct - number of queries: 6471
49 Correct 6 ms 5236 KB Output is correct
50 Partially correct 51 ms 5296 KB Partially correct - number of queries: 8548
51 Correct 21 ms 5696 KB Output is correct
52 Correct 4 ms 4952 KB Output is correct
53 Correct 4 ms 4952 KB Output is correct
54 Correct 17 ms 5208 KB Output is correct
55 Correct 3 ms 4952 KB Output is correct
56 Partially correct 50 ms 5392 KB Partially correct - number of queries: 8543
57 Partially correct 35 ms 5512 KB Partially correct - number of queries: 6376
58 Partially correct 29 ms 5456 KB Partially correct - number of queries: 6502
59 Partially correct 29 ms 5452 KB Partially correct - number of queries: 5490
60 Partially correct 26 ms 5464 KB Partially correct - number of queries: 5086
61 Correct 4 ms 4952 KB Output is correct
62 Correct 6 ms 4952 KB Output is correct
63 Correct 4 ms 4952 KB Output is correct
64 Correct 4 ms 4952 KB Output is correct
65 Correct 5 ms 4952 KB Output is correct
66 Correct 7 ms 5208 KB Output is correct
67 Correct 4 ms 5208 KB Output is correct
68 Correct 4 ms 4952 KB Output is correct
69 Correct 7 ms 4952 KB Output is correct
70 Correct 5 ms 4952 KB Output is correct
71 Partially correct 26 ms 5464 KB Partially correct - number of queries: 5601
72 Correct 7 ms 5208 KB Output is correct
73 Partially correct 25 ms 5276 KB Partially correct - number of queries: 5549
74 Partially correct 26 ms 5200 KB Partially correct - number of queries: 5528
75 Correct 6 ms 5144 KB Output is correct
76 Partially correct 45 ms 5208 KB Partially correct - number of queries: 5020
77 Partially correct 39 ms 5708 KB Partially correct - number of queries: 8407
78 Correct 5 ms 4952 KB Output is correct
79 Correct 14 ms 5200 KB Output is correct
80 Partially correct 43 ms 5200 KB Partially correct - number of queries: 8351
81 Partially correct 43 ms 5456 KB Partially correct - number of queries: 8381
82 Partially correct 40 ms 5748 KB Partially correct - number of queries: 8364
83 Correct 4 ms 4952 KB Output is correct
84 Partially correct 44 ms 5456 KB Partially correct - number of queries: 6904
85 Partially correct 53 ms 5432 KB Partially correct - number of queries: 8385
86 Partially correct 42 ms 5264 KB Partially correct - number of queries: 7389
87 Correct 4 ms 4952 KB Output is correct
88 Partially correct 28 ms 5456 KB Partially correct - number of queries: 5075
89 Partially correct 40 ms 5492 KB Partially correct - number of queries: 7123
90 Correct 3 ms 5208 KB Output is correct
91 Correct 11 ms 4952 KB Output is correct
92 Partially correct 36 ms 5200 KB Partially correct - number of queries: 6840
93 Partially correct 34 ms 5456 KB Partially correct - number of queries: 7538
94 Partially correct 42 ms 5208 KB Partially correct - number of queries: 7945
95 Partially correct 54 ms 5656 KB Partially correct - number of queries: 7975
96 Partially correct 46 ms 5192 KB Partially correct - number of queries: 7949
97 Partially correct 42 ms 5712 KB Partially correct - number of queries: 7280