# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145181 | 2019-08-19T08:22:27 Z | TadijaSebez | Exhibition (JOI19_ho_t2) | C++11 | 218 ms | 11248 KB |
#include <bits/stdc++.h> using namespace std; const int N=100050; bool was[N]; set<pair<pair<int,int>,int>> all; int sz[N],v[N],id[N]; int main() { int n,m; scanf("%i %i",&n,&m); for(int i=1;i<=n;i++) scanf("%i %i",&sz[i],&v[i]),id[i]=i,all.insert({{v[i],sz[i]},i}); sort(id+1,id+1+n,[&](int i, int j){ return sz[i]>sz[j];}); vector<int> c(m); for(int i=0;i<m;i++) scanf("%i",&c[i]); sort(c.rbegin(),c.rend()); int ans=0,ptr=1; for(int S:c) { while(ptr<=n && sz[id[ptr]]>S) { if(!was[id[ptr]]) all.erase({{v[id[ptr]],sz[id[ptr]]},id[ptr]}); ptr++; } if(all.empty()) break; int i=all.rbegin()->second; all.erase(--all.end()); was[i]=1; ans++; } printf("%i\n",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 2 ms | 348 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 2 ms | 348 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 3 ms | 376 KB | Output is correct |
21 | Correct | 3 ms | 504 KB | Output is correct |
22 | Correct | 3 ms | 504 KB | Output is correct |
23 | Correct | 3 ms | 504 KB | Output is correct |
24 | Correct | 4 ms | 552 KB | Output is correct |
25 | Correct | 3 ms | 376 KB | Output is correct |
26 | Correct | 3 ms | 376 KB | Output is correct |
27 | Correct | 3 ms | 376 KB | Output is correct |
28 | Correct | 3 ms | 504 KB | Output is correct |
29 | Correct | 3 ms | 504 KB | Output is correct |
30 | Correct | 3 ms | 504 KB | Output is correct |
31 | Correct | 3 ms | 504 KB | Output is correct |
32 | Correct | 3 ms | 504 KB | Output is correct |
33 | Correct | 2 ms | 376 KB | Output is correct |
34 | Correct | 3 ms | 504 KB | Output is correct |
35 | Correct | 2 ms | 376 KB | Output is correct |
36 | Correct | 3 ms | 504 KB | Output is correct |
37 | Correct | 3 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 2 ms | 348 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 3 ms | 376 KB | Output is correct |
21 | Correct | 3 ms | 504 KB | Output is correct |
22 | Correct | 3 ms | 504 KB | Output is correct |
23 | Correct | 3 ms | 504 KB | Output is correct |
24 | Correct | 4 ms | 552 KB | Output is correct |
25 | Correct | 3 ms | 376 KB | Output is correct |
26 | Correct | 3 ms | 376 KB | Output is correct |
27 | Correct | 3 ms | 376 KB | Output is correct |
28 | Correct | 3 ms | 504 KB | Output is correct |
29 | Correct | 3 ms | 504 KB | Output is correct |
30 | Correct | 3 ms | 504 KB | Output is correct |
31 | Correct | 3 ms | 504 KB | Output is correct |
32 | Correct | 3 ms | 504 KB | Output is correct |
33 | Correct | 2 ms | 376 KB | Output is correct |
34 | Correct | 3 ms | 504 KB | Output is correct |
35 | Correct | 2 ms | 376 KB | Output is correct |
36 | Correct | 3 ms | 504 KB | Output is correct |
37 | Correct | 3 ms | 376 KB | Output is correct |
38 | Correct | 141 ms | 11132 KB | Output is correct |
39 | Correct | 139 ms | 11128 KB | Output is correct |
40 | Correct | 128 ms | 11180 KB | Output is correct |
41 | Correct | 153 ms | 11116 KB | Output is correct |
42 | Correct | 147 ms | 11108 KB | Output is correct |
43 | Correct | 153 ms | 11000 KB | Output is correct |
44 | Correct | 150 ms | 11128 KB | Output is correct |
45 | Correct | 148 ms | 11192 KB | Output is correct |
46 | Correct | 140 ms | 11084 KB | Output is correct |
47 | Correct | 158 ms | 10744 KB | Output is correct |
48 | Correct | 144 ms | 10744 KB | Output is correct |
49 | Correct | 105 ms | 8312 KB | Output is correct |
50 | Correct | 107 ms | 8400 KB | Output is correct |
51 | Correct | 189 ms | 11128 KB | Output is correct |
52 | Correct | 183 ms | 11000 KB | Output is correct |
53 | Correct | 186 ms | 11148 KB | Output is correct |
54 | Correct | 121 ms | 11128 KB | Output is correct |
55 | Correct | 139 ms | 11128 KB | Output is correct |
56 | Correct | 140 ms | 9848 KB | Output is correct |
57 | Correct | 29 ms | 1656 KB | Output is correct |
58 | Correct | 129 ms | 9720 KB | Output is correct |
59 | Correct | 158 ms | 9848 KB | Output is correct |
60 | Correct | 29 ms | 1784 KB | Output is correct |
61 | Correct | 64 ms | 4984 KB | Output is correct |
62 | Correct | 166 ms | 11120 KB | Output is correct |
63 | Correct | 164 ms | 11248 KB | Output is correct |
64 | Correct | 190 ms | 11204 KB | Output is correct |
65 | Correct | 166 ms | 11228 KB | Output is correct |
66 | Correct | 172 ms | 11140 KB | Output is correct |
67 | Correct | 166 ms | 11128 KB | Output is correct |
68 | Correct | 169 ms | 11148 KB | Output is correct |
69 | Correct | 166 ms | 11128 KB | Output is correct |
70 | Correct | 162 ms | 11128 KB | Output is correct |
71 | Correct | 218 ms | 11128 KB | Output is correct |
72 | Correct | 152 ms | 11128 KB | Output is correct |
73 | Correct | 155 ms | 11128 KB | Output is correct |