#include "closing.h"
#include<bits/stdc++.h>
using namespace std;
const int c=200005;
vector<pair<int, long long> > sz[c];
vector<pair<int, long long> > sor;
long long n, dist[c][2], bal, jobb, len, pref[2*c], inf=1e18;
bool ut[c];
void dfs(int a, int el, long long tav, int id) {
dist[a][id]=tav;
for (auto p:sz[a]) {
int x=p.first;
long long y=tav+p.second;
if (x!=el) {
dfs(x, a, y, id);
}
}
}
bool dfs2(int a, int el, long long tav) {
if (a==jobb) {
sor.push_back({a, tav});
ut[a]=1;
return true;
}
for (auto p:sz[a]) {
int x=p.first;
long long y=tav+p.second;
if (x!=el) {
if (dfs2(x, a, y)) {
sor.push_back({a, tav});
ut[a]=1;
return true;
}
}
}
return false;
}
long long calc(long long ert) {
if (ert<0) {
return -inf;
}
int lo=0, hi=2*n+1, mid;
while (hi-lo>1) {
mid=(hi+lo)/2;
if (pref[mid]<=ert) {
lo=mid;
} else {
hi=mid;
}
}
return lo;
}
int max_score(int N, int X, int Y, long long K, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
n=N;
for (int i=0; i<n-1; i++) {
int a=U[i], b=V[i], c=W[i];
sz[a].push_back({b, c});
sz[b].push_back({a, c});
}
bal=X, jobb=Y;
dfs(bal, -1, 0, 0), dfs(jobb, -1, 0, 1);
len=dist[jobb][0];
long long spec=0, maxi=0;
if (true) {
vector<long long> p;
for (int i=0; i<n; i++) {
p.push_back(dist[i][0]);
p.push_back(dist[i][1]);
}
sort(p.begin(), p.end());
long long sum=0, cnt=0;
for (auto x:p) {
if (sum+x<=K) {
sum+=x;
cnt++;
}
}
spec=cnt;
}
bool s=dfs2(bal, -1, 0);
reverse(sor.begin(), sor.end());
long long si=sor.size(), sum=0, cnt=0, kezd=0, veg=si-1;
while (kezd<=veg) {
if (sor[kezd].second<=len-sor[veg].second) {
cnt++;
sum+=sor[kezd].second;
kezd++;
} else {
cnt++;
sum+=len-sor[veg].second;
veg--;
}
}
vector<long long> add;
for (int i=kezd; i<si; i++) {
add.push_back(2*sor[i].second-len);
}
for (int i=0; i<=veg; i++) {
add.push_back(len-2*sor[i].second);
}
for (int i=1; i<=2*n; i++) {
pref[i]=inf;
}
vector<pair<long long, long long> > dupla;
vector<long long> prefmax, sufmin;
for (int i=0; i<n; i++) {
if (ut[i]) {
continue;
}
long long a=dist[i][0], b=dist[i][1];
if (a>b) {
swap(a, b);
}
if (2*a<=b) {
add.push_back(a);
add.push_back(b-a);
} else {
dupla.push_back({b, a});
}
}
sort(add.begin(), add.end());
assert(add[0]>=0);
for (int i=0; i<add.size(); i++) {
pref[i+1]=pref[i]+add[i];
}
if (dupla.size()>0) {
sort(dupla.begin(), dupla.end());
int ds=dupla.size();
prefmax.resize(ds), sufmin.resize(ds);
prefmax[0]=dupla[0].first-dupla[0].second;
for (int i=1; i<ds; i++) {
prefmax[i]=max(prefmax[i-1], dupla[i].first-dupla[i].second);
}
sufmin[ds-1]=dupla[ds-1].second;
for (int i=ds-2; i>=0; i--) {
sufmin[i]=min(sufmin[i+1], dupla[i].second);
}
maxi=max(maxi, cnt+calc(K-sum));
maxi=max(maxi, cnt+1+calc(K-sum-sufmin[0]));
for (int i=0; i<ds; i++) {
sum+=dupla[i].first;
maxi=max(maxi, cnt+2*i+1+calc(K-sum+prefmax[i]));
maxi=max(maxi, cnt+2*i+2+calc(K-sum));
if (i+1<ds) {
maxi=max(maxi, cnt+2*i+3+calc(K-sum-sufmin[i+1]));
}
}
}
maxi=max(maxi, cnt+calc(K-sum));
for (int i=0; i<=n; i++) {
sz[i].clear();
ut[i]=0;
}
sor.clear();
len=0;
return max(maxi, spec);
}
Compilation message
closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:123:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
123 | for (int i=0; i<add.size(); i++) {
| ~^~~~~~~~~~~
closing.cpp:80:10: warning: unused variable 's' [-Wunused-variable]
80 | bool s=dfs2(bal, -1, 0);
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
124 ms |
42716 KB |
Output is correct |
2 |
Correct |
127 ms |
54000 KB |
Output is correct |
3 |
Correct |
75 ms |
14676 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
1 ms |
9308 KB |
Output is correct |
3 |
Correct |
2 ms |
9308 KB |
Output is correct |
4 |
Correct |
1 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
2 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
1 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
1 ms |
9308 KB |
Output is correct |
3 |
Correct |
2 ms |
9308 KB |
Output is correct |
4 |
Correct |
1 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
2 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
1 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9368 KB |
Output is correct |
12 |
Correct |
1 ms |
9384 KB |
Output is correct |
13 |
Correct |
1 ms |
9308 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
2 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9360 KB |
Output is correct |
17 |
Correct |
1 ms |
9308 KB |
Output is correct |
18 |
Correct |
2 ms |
9304 KB |
Output is correct |
19 |
Correct |
2 ms |
9368 KB |
Output is correct |
20 |
Correct |
1 ms |
9308 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
2 ms |
9304 KB |
Output is correct |
23 |
Correct |
2 ms |
9308 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
1 ms |
9308 KB |
Output is correct |
3 |
Correct |
2 ms |
9308 KB |
Output is correct |
4 |
Correct |
1 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
2 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
1 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9368 KB |
Output is correct |
12 |
Correct |
1 ms |
9384 KB |
Output is correct |
13 |
Correct |
1 ms |
9308 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
2 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9360 KB |
Output is correct |
17 |
Correct |
1 ms |
9308 KB |
Output is correct |
18 |
Correct |
2 ms |
9304 KB |
Output is correct |
19 |
Correct |
2 ms |
9368 KB |
Output is correct |
20 |
Correct |
1 ms |
9308 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
2 ms |
9304 KB |
Output is correct |
23 |
Correct |
2 ms |
9308 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
25 |
Correct |
2 ms |
9308 KB |
Output is correct |
26 |
Correct |
3 ms |
9820 KB |
Output is correct |
27 |
Correct |
3 ms |
9820 KB |
Output is correct |
28 |
Correct |
3 ms |
9792 KB |
Output is correct |
29 |
Correct |
3 ms |
9704 KB |
Output is correct |
30 |
Correct |
2 ms |
9820 KB |
Output is correct |
31 |
Correct |
3 ms |
9960 KB |
Output is correct |
32 |
Correct |
3 ms |
9820 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
2 ms |
9308 KB |
Output is correct |
3 |
Correct |
1 ms |
9308 KB |
Output is correct |
4 |
Correct |
2 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
2 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9364 KB |
Output is correct |
9 |
Correct |
2 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9308 KB |
Output is correct |
12 |
Correct |
2 ms |
9308 KB |
Output is correct |
13 |
Correct |
1 ms |
9308 KB |
Output is correct |
14 |
Correct |
1 ms |
9304 KB |
Output is correct |
15 |
Correct |
2 ms |
9308 KB |
Output is correct |
16 |
Correct |
1 ms |
9308 KB |
Output is correct |
17 |
Correct |
1 ms |
9308 KB |
Output is correct |
18 |
Correct |
1 ms |
9308 KB |
Output is correct |
19 |
Correct |
1 ms |
9308 KB |
Output is correct |
20 |
Correct |
1 ms |
9308 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
2 ms |
9308 KB |
Output is correct |
23 |
Correct |
2 ms |
9308 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
2 ms |
9308 KB |
Output is correct |
3 |
Correct |
1 ms |
9308 KB |
Output is correct |
4 |
Correct |
2 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
1 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
2 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9308 KB |
Output is correct |
12 |
Correct |
1 ms |
9368 KB |
Output is correct |
13 |
Correct |
1 ms |
9384 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
1 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9308 KB |
Output is correct |
17 |
Correct |
2 ms |
9360 KB |
Output is correct |
18 |
Correct |
1 ms |
9308 KB |
Output is correct |
19 |
Correct |
2 ms |
9308 KB |
Output is correct |
20 |
Correct |
2 ms |
9364 KB |
Output is correct |
21 |
Correct |
2 ms |
9308 KB |
Output is correct |
22 |
Correct |
1 ms |
9308 KB |
Output is correct |
23 |
Correct |
1 ms |
9308 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
25 |
Correct |
1 ms |
9308 KB |
Output is correct |
26 |
Correct |
1 ms |
9304 KB |
Output is correct |
27 |
Correct |
2 ms |
9308 KB |
Output is correct |
28 |
Correct |
1 ms |
9308 KB |
Output is correct |
29 |
Correct |
1 ms |
9308 KB |
Output is correct |
30 |
Correct |
1 ms |
9308 KB |
Output is correct |
31 |
Correct |
1 ms |
9308 KB |
Output is correct |
32 |
Correct |
1 ms |
9308 KB |
Output is correct |
33 |
Correct |
1 ms |
9308 KB |
Output is correct |
34 |
Correct |
2 ms |
9308 KB |
Output is correct |
35 |
Correct |
2 ms |
9308 KB |
Output is correct |
36 |
Correct |
2 ms |
9308 KB |
Output is correct |
37 |
Correct |
2 ms |
9308 KB |
Output is correct |
38 |
Correct |
2 ms |
9308 KB |
Output is correct |
39 |
Correct |
2 ms |
9560 KB |
Output is correct |
40 |
Correct |
1 ms |
9308 KB |
Output is correct |
41 |
Correct |
1 ms |
9308 KB |
Output is correct |
42 |
Correct |
1 ms |
9308 KB |
Output is correct |
43 |
Correct |
2 ms |
9368 KB |
Output is correct |
44 |
Correct |
1 ms |
9308 KB |
Output is correct |
45 |
Correct |
1 ms |
9308 KB |
Output is correct |
46 |
Correct |
2 ms |
9352 KB |
Output is correct |
47 |
Correct |
1 ms |
9364 KB |
Output is correct |
48 |
Correct |
2 ms |
9308 KB |
Output is correct |
49 |
Correct |
2 ms |
9304 KB |
Output is correct |
50 |
Correct |
1 ms |
9308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
2 ms |
9308 KB |
Output is correct |
3 |
Correct |
1 ms |
9308 KB |
Output is correct |
4 |
Correct |
2 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
1 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
2 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9308 KB |
Output is correct |
12 |
Correct |
1 ms |
9368 KB |
Output is correct |
13 |
Correct |
1 ms |
9384 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
1 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9308 KB |
Output is correct |
17 |
Correct |
2 ms |
9360 KB |
Output is correct |
18 |
Correct |
1 ms |
9308 KB |
Output is correct |
19 |
Correct |
2 ms |
9304 KB |
Output is correct |
20 |
Correct |
2 ms |
9368 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
1 ms |
9308 KB |
Output is correct |
23 |
Correct |
2 ms |
9304 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
25 |
Correct |
2 ms |
9308 KB |
Output is correct |
26 |
Correct |
2 ms |
9308 KB |
Output is correct |
27 |
Correct |
2 ms |
9364 KB |
Output is correct |
28 |
Correct |
2 ms |
9308 KB |
Output is correct |
29 |
Correct |
1 ms |
9308 KB |
Output is correct |
30 |
Correct |
1 ms |
9308 KB |
Output is correct |
31 |
Correct |
2 ms |
9308 KB |
Output is correct |
32 |
Correct |
1 ms |
9308 KB |
Output is correct |
33 |
Correct |
1 ms |
9304 KB |
Output is correct |
34 |
Correct |
2 ms |
9308 KB |
Output is correct |
35 |
Correct |
1 ms |
9308 KB |
Output is correct |
36 |
Correct |
1 ms |
9308 KB |
Output is correct |
37 |
Correct |
1 ms |
9308 KB |
Output is correct |
38 |
Correct |
1 ms |
9308 KB |
Output is correct |
39 |
Correct |
1 ms |
9308 KB |
Output is correct |
40 |
Correct |
1 ms |
9308 KB |
Output is correct |
41 |
Correct |
2 ms |
9308 KB |
Output is correct |
42 |
Correct |
2 ms |
9308 KB |
Output is correct |
43 |
Correct |
2 ms |
9308 KB |
Output is correct |
44 |
Correct |
2 ms |
9308 KB |
Output is correct |
45 |
Correct |
2 ms |
9308 KB |
Output is correct |
46 |
Correct |
2 ms |
9560 KB |
Output is correct |
47 |
Correct |
1 ms |
9308 KB |
Output is correct |
48 |
Correct |
1 ms |
9308 KB |
Output is correct |
49 |
Correct |
1 ms |
9308 KB |
Output is correct |
50 |
Correct |
2 ms |
9368 KB |
Output is correct |
51 |
Correct |
1 ms |
9308 KB |
Output is correct |
52 |
Correct |
1 ms |
9308 KB |
Output is correct |
53 |
Correct |
2 ms |
9352 KB |
Output is correct |
54 |
Correct |
1 ms |
9364 KB |
Output is correct |
55 |
Correct |
2 ms |
9308 KB |
Output is correct |
56 |
Correct |
2 ms |
9304 KB |
Output is correct |
57 |
Correct |
1 ms |
9308 KB |
Output is correct |
58 |
Correct |
2 ms |
9308 KB |
Output is correct |
59 |
Correct |
2 ms |
9308 KB |
Output is correct |
60 |
Correct |
2 ms |
9304 KB |
Output is correct |
61 |
Correct |
1 ms |
9308 KB |
Output is correct |
62 |
Correct |
1 ms |
9308 KB |
Output is correct |
63 |
Correct |
2 ms |
9308 KB |
Output is correct |
64 |
Correct |
2 ms |
9308 KB |
Output is correct |
65 |
Correct |
2 ms |
9308 KB |
Output is correct |
66 |
Correct |
2 ms |
9308 KB |
Output is correct |
67 |
Correct |
1 ms |
9308 KB |
Output is correct |
68 |
Correct |
2 ms |
9308 KB |
Output is correct |
69 |
Correct |
2 ms |
9308 KB |
Output is correct |
70 |
Correct |
2 ms |
9308 KB |
Output is correct |
71 |
Correct |
2 ms |
9308 KB |
Output is correct |
72 |
Correct |
2 ms |
9308 KB |
Output is correct |
73 |
Correct |
2 ms |
9392 KB |
Output is correct |
74 |
Correct |
2 ms |
9308 KB |
Output is correct |
75 |
Correct |
2 ms |
9308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
2 ms |
9308 KB |
Output is correct |
3 |
Correct |
1 ms |
9308 KB |
Output is correct |
4 |
Correct |
2 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
1 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
2 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9308 KB |
Output is correct |
12 |
Correct |
1 ms |
9368 KB |
Output is correct |
13 |
Correct |
1 ms |
9384 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
1 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9308 KB |
Output is correct |
17 |
Correct |
2 ms |
9360 KB |
Output is correct |
18 |
Correct |
1 ms |
9308 KB |
Output is correct |
19 |
Correct |
2 ms |
9304 KB |
Output is correct |
20 |
Correct |
2 ms |
9368 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
1 ms |
9308 KB |
Output is correct |
23 |
Correct |
2 ms |
9304 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
25 |
Correct |
2 ms |
9308 KB |
Output is correct |
26 |
Correct |
2 ms |
9308 KB |
Output is correct |
27 |
Correct |
3 ms |
9820 KB |
Output is correct |
28 |
Correct |
3 ms |
9820 KB |
Output is correct |
29 |
Correct |
3 ms |
9792 KB |
Output is correct |
30 |
Correct |
3 ms |
9704 KB |
Output is correct |
31 |
Correct |
2 ms |
9820 KB |
Output is correct |
32 |
Correct |
3 ms |
9960 KB |
Output is correct |
33 |
Correct |
3 ms |
9820 KB |
Output is correct |
34 |
Correct |
2 ms |
9308 KB |
Output is correct |
35 |
Correct |
2 ms |
9364 KB |
Output is correct |
36 |
Correct |
2 ms |
9308 KB |
Output is correct |
37 |
Correct |
1 ms |
9308 KB |
Output is correct |
38 |
Correct |
1 ms |
9308 KB |
Output is correct |
39 |
Correct |
2 ms |
9308 KB |
Output is correct |
40 |
Correct |
1 ms |
9308 KB |
Output is correct |
41 |
Correct |
1 ms |
9304 KB |
Output is correct |
42 |
Correct |
2 ms |
9308 KB |
Output is correct |
43 |
Correct |
1 ms |
9308 KB |
Output is correct |
44 |
Correct |
1 ms |
9308 KB |
Output is correct |
45 |
Correct |
1 ms |
9308 KB |
Output is correct |
46 |
Correct |
1 ms |
9308 KB |
Output is correct |
47 |
Correct |
1 ms |
9308 KB |
Output is correct |
48 |
Correct |
1 ms |
9308 KB |
Output is correct |
49 |
Correct |
2 ms |
9308 KB |
Output is correct |
50 |
Correct |
2 ms |
9308 KB |
Output is correct |
51 |
Correct |
2 ms |
9308 KB |
Output is correct |
52 |
Correct |
2 ms |
9308 KB |
Output is correct |
53 |
Correct |
2 ms |
9308 KB |
Output is correct |
54 |
Correct |
2 ms |
9560 KB |
Output is correct |
55 |
Correct |
1 ms |
9308 KB |
Output is correct |
56 |
Correct |
1 ms |
9308 KB |
Output is correct |
57 |
Correct |
1 ms |
9308 KB |
Output is correct |
58 |
Correct |
2 ms |
9368 KB |
Output is correct |
59 |
Correct |
1 ms |
9308 KB |
Output is correct |
60 |
Correct |
1 ms |
9308 KB |
Output is correct |
61 |
Correct |
2 ms |
9352 KB |
Output is correct |
62 |
Correct |
1 ms |
9364 KB |
Output is correct |
63 |
Correct |
2 ms |
9308 KB |
Output is correct |
64 |
Correct |
2 ms |
9304 KB |
Output is correct |
65 |
Correct |
1 ms |
9308 KB |
Output is correct |
66 |
Correct |
2 ms |
9308 KB |
Output is correct |
67 |
Correct |
2 ms |
9308 KB |
Output is correct |
68 |
Correct |
2 ms |
9304 KB |
Output is correct |
69 |
Correct |
1 ms |
9308 KB |
Output is correct |
70 |
Correct |
1 ms |
9308 KB |
Output is correct |
71 |
Correct |
2 ms |
9308 KB |
Output is correct |
72 |
Correct |
2 ms |
9308 KB |
Output is correct |
73 |
Correct |
2 ms |
9308 KB |
Output is correct |
74 |
Correct |
2 ms |
9308 KB |
Output is correct |
75 |
Correct |
1 ms |
9308 KB |
Output is correct |
76 |
Correct |
2 ms |
9308 KB |
Output is correct |
77 |
Correct |
2 ms |
9308 KB |
Output is correct |
78 |
Correct |
2 ms |
9308 KB |
Output is correct |
79 |
Correct |
2 ms |
9308 KB |
Output is correct |
80 |
Correct |
2 ms |
9308 KB |
Output is correct |
81 |
Correct |
2 ms |
9392 KB |
Output is correct |
82 |
Correct |
2 ms |
9308 KB |
Output is correct |
83 |
Correct |
2 ms |
9308 KB |
Output is correct |
84 |
Correct |
2 ms |
9304 KB |
Output is correct |
85 |
Correct |
3 ms |
9308 KB |
Output is correct |
86 |
Correct |
2 ms |
9304 KB |
Output is correct |
87 |
Correct |
2 ms |
9308 KB |
Output is correct |
88 |
Correct |
3 ms |
9308 KB |
Output is correct |
89 |
Correct |
3 ms |
9564 KB |
Output is correct |
90 |
Correct |
3 ms |
9696 KB |
Output is correct |
91 |
Correct |
4 ms |
9636 KB |
Output is correct |
92 |
Correct |
3 ms |
9564 KB |
Output is correct |
93 |
Correct |
3 ms |
9568 KB |
Output is correct |
94 |
Correct |
3 ms |
9824 KB |
Output is correct |
95 |
Correct |
3 ms |
10000 KB |
Output is correct |
96 |
Correct |
3 ms |
9816 KB |
Output is correct |
97 |
Correct |
3 ms |
9820 KB |
Output is correct |
98 |
Correct |
3 ms |
9564 KB |
Output is correct |
99 |
Correct |
3 ms |
9576 KB |
Output is correct |
100 |
Correct |
3 ms |
9564 KB |
Output is correct |
101 |
Correct |
3 ms |
9304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9308 KB |
Output is correct |
2 |
Correct |
2 ms |
9308 KB |
Output is correct |
3 |
Correct |
1 ms |
9308 KB |
Output is correct |
4 |
Correct |
2 ms |
9308 KB |
Output is correct |
5 |
Correct |
1 ms |
9308 KB |
Output is correct |
6 |
Correct |
1 ms |
9308 KB |
Output is correct |
7 |
Correct |
1 ms |
9308 KB |
Output is correct |
8 |
Correct |
2 ms |
9308 KB |
Output is correct |
9 |
Correct |
2 ms |
9308 KB |
Output is correct |
10 |
Correct |
1 ms |
9308 KB |
Output is correct |
11 |
Correct |
1 ms |
9308 KB |
Output is correct |
12 |
Correct |
1 ms |
9368 KB |
Output is correct |
13 |
Correct |
1 ms |
9384 KB |
Output is correct |
14 |
Correct |
1 ms |
9308 KB |
Output is correct |
15 |
Correct |
1 ms |
9308 KB |
Output is correct |
16 |
Correct |
2 ms |
9308 KB |
Output is correct |
17 |
Correct |
2 ms |
9360 KB |
Output is correct |
18 |
Correct |
1 ms |
9308 KB |
Output is correct |
19 |
Correct |
2 ms |
9304 KB |
Output is correct |
20 |
Correct |
2 ms |
9368 KB |
Output is correct |
21 |
Correct |
1 ms |
9308 KB |
Output is correct |
22 |
Correct |
1 ms |
9308 KB |
Output is correct |
23 |
Correct |
2 ms |
9304 KB |
Output is correct |
24 |
Correct |
2 ms |
9308 KB |
Output is correct |
25 |
Correct |
2 ms |
9308 KB |
Output is correct |
26 |
Correct |
2 ms |
9308 KB |
Output is correct |
27 |
Correct |
3 ms |
9820 KB |
Output is correct |
28 |
Correct |
3 ms |
9820 KB |
Output is correct |
29 |
Correct |
3 ms |
9792 KB |
Output is correct |
30 |
Correct |
3 ms |
9704 KB |
Output is correct |
31 |
Correct |
2 ms |
9820 KB |
Output is correct |
32 |
Correct |
3 ms |
9960 KB |
Output is correct |
33 |
Correct |
3 ms |
9820 KB |
Output is correct |
34 |
Correct |
2 ms |
9308 KB |
Output is correct |
35 |
Correct |
2 ms |
9364 KB |
Output is correct |
36 |
Correct |
2 ms |
9308 KB |
Output is correct |
37 |
Correct |
1 ms |
9308 KB |
Output is correct |
38 |
Correct |
1 ms |
9308 KB |
Output is correct |
39 |
Correct |
2 ms |
9308 KB |
Output is correct |
40 |
Correct |
1 ms |
9308 KB |
Output is correct |
41 |
Correct |
1 ms |
9304 KB |
Output is correct |
42 |
Correct |
2 ms |
9308 KB |
Output is correct |
43 |
Correct |
1 ms |
9308 KB |
Output is correct |
44 |
Correct |
1 ms |
9308 KB |
Output is correct |
45 |
Correct |
1 ms |
9308 KB |
Output is correct |
46 |
Correct |
1 ms |
9308 KB |
Output is correct |
47 |
Correct |
1 ms |
9308 KB |
Output is correct |
48 |
Correct |
1 ms |
9308 KB |
Output is correct |
49 |
Correct |
2 ms |
9308 KB |
Output is correct |
50 |
Correct |
2 ms |
9308 KB |
Output is correct |
51 |
Correct |
2 ms |
9308 KB |
Output is correct |
52 |
Correct |
2 ms |
9308 KB |
Output is correct |
53 |
Correct |
2 ms |
9308 KB |
Output is correct |
54 |
Correct |
2 ms |
9560 KB |
Output is correct |
55 |
Correct |
1 ms |
9308 KB |
Output is correct |
56 |
Correct |
1 ms |
9308 KB |
Output is correct |
57 |
Correct |
1 ms |
9308 KB |
Output is correct |
58 |
Correct |
2 ms |
9368 KB |
Output is correct |
59 |
Correct |
1 ms |
9308 KB |
Output is correct |
60 |
Correct |
1 ms |
9308 KB |
Output is correct |
61 |
Correct |
2 ms |
9352 KB |
Output is correct |
62 |
Correct |
1 ms |
9364 KB |
Output is correct |
63 |
Correct |
2 ms |
9308 KB |
Output is correct |
64 |
Correct |
2 ms |
9304 KB |
Output is correct |
65 |
Correct |
1 ms |
9308 KB |
Output is correct |
66 |
Correct |
2 ms |
9308 KB |
Output is correct |
67 |
Correct |
2 ms |
9308 KB |
Output is correct |
68 |
Correct |
2 ms |
9304 KB |
Output is correct |
69 |
Correct |
1 ms |
9308 KB |
Output is correct |
70 |
Correct |
1 ms |
9308 KB |
Output is correct |
71 |
Correct |
2 ms |
9308 KB |
Output is correct |
72 |
Correct |
2 ms |
9308 KB |
Output is correct |
73 |
Correct |
2 ms |
9308 KB |
Output is correct |
74 |
Correct |
2 ms |
9308 KB |
Output is correct |
75 |
Correct |
1 ms |
9308 KB |
Output is correct |
76 |
Correct |
2 ms |
9308 KB |
Output is correct |
77 |
Correct |
2 ms |
9308 KB |
Output is correct |
78 |
Correct |
2 ms |
9308 KB |
Output is correct |
79 |
Correct |
2 ms |
9308 KB |
Output is correct |
80 |
Correct |
2 ms |
9308 KB |
Output is correct |
81 |
Correct |
2 ms |
9392 KB |
Output is correct |
82 |
Correct |
2 ms |
9308 KB |
Output is correct |
83 |
Correct |
2 ms |
9308 KB |
Output is correct |
84 |
Correct |
2 ms |
9304 KB |
Output is correct |
85 |
Correct |
3 ms |
9308 KB |
Output is correct |
86 |
Correct |
2 ms |
9304 KB |
Output is correct |
87 |
Correct |
2 ms |
9308 KB |
Output is correct |
88 |
Correct |
3 ms |
9308 KB |
Output is correct |
89 |
Correct |
3 ms |
9564 KB |
Output is correct |
90 |
Correct |
3 ms |
9696 KB |
Output is correct |
91 |
Correct |
4 ms |
9636 KB |
Output is correct |
92 |
Correct |
3 ms |
9564 KB |
Output is correct |
93 |
Correct |
3 ms |
9568 KB |
Output is correct |
94 |
Correct |
3 ms |
9824 KB |
Output is correct |
95 |
Correct |
3 ms |
10000 KB |
Output is correct |
96 |
Correct |
3 ms |
9816 KB |
Output is correct |
97 |
Correct |
3 ms |
9820 KB |
Output is correct |
98 |
Correct |
3 ms |
9564 KB |
Output is correct |
99 |
Correct |
3 ms |
9576 KB |
Output is correct |
100 |
Correct |
3 ms |
9564 KB |
Output is correct |
101 |
Correct |
3 ms |
9304 KB |
Output is correct |
102 |
Correct |
62 ms |
14520 KB |
Output is correct |
103 |
Correct |
69 ms |
14420 KB |
Output is correct |
104 |
Correct |
132 ms |
47780 KB |
Output is correct |
105 |
Correct |
84 ms |
16036 KB |
Output is correct |
106 |
Correct |
84 ms |
15936 KB |
Output is correct |
107 |
Correct |
57 ms |
33820 KB |
Output is correct |
108 |
Correct |
58 ms |
34772 KB |
Output is correct |
109 |
Correct |
94 ms |
51100 KB |
Output is correct |
110 |
Correct |
151 ms |
37904 KB |
Output is correct |
111 |
Correct |
119 ms |
47276 KB |
Output is correct |
112 |
Correct |
122 ms |
38340 KB |
Output is correct |
113 |
Correct |
121 ms |
38040 KB |
Output is correct |
114 |
Correct |
111 ms |
37452 KB |
Output is correct |
115 |
Correct |
98 ms |
56560 KB |
Output is correct |
116 |
Correct |
132 ms |
44172 KB |
Output is correct |
117 |
Correct |
140 ms |
43412 KB |
Output is correct |
118 |
Correct |
132 ms |
37880 KB |
Output is correct |
119 |
Correct |
96 ms |
18576 KB |
Output is correct |
120 |
Correct |
61 ms |
14080 KB |
Output is correct |