#include "closing.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
struct dat{
int x; ll v;
dat(){}
dat(int x, ll v): x(x), v(v){}
bool operator<(const dat &r)const{
if(v!=r.v) return v<r.v;
return x<r.x;
}
};
struct Result{
int A, B; ll profit;
Result(){}
Result(int A, int B, ll profit): A(A), B(B), profit(profit){}
bool operator<(const Result &r)const{
return profit < r.profit;
}
};
int n, s, e; ll k;
vector<pair<int, ll> > link[200002];
ll sdist[200002], edist[200002];
ll v1[200002], v2[200002];
void dfs(int x, int p, ll d, ll *dist){
dist[x] = d;
for(pair<int, ll> y: link[x]){
if(y.first == p) continue;
dfs(y.first, x, d+y.second, dist);
}
}
ll arr[200002][3];
ll state[200002];
ll allSum;
set<dat> st[3][3];
void update(int x){
for(int i=0; i<3; i++){
if(state[x] == i) continue;
st[state[x]][i].insert(dat(x, arr[x][i] - arr[x][state[x]]));
}
}
void remove(int x){
for(int i=0; i<3; i++){
if(state[x] == i) continue;
st[state[x]][i].erase(dat(x, arr[x][i] - arr[x][state[x]]));
}
}
void up(int x){
allSum += arr[x][state[x]+1] - arr[x][state[x]];
state[x]++;
}
void down(int x){
state[x]--;
allSum -= arr[x][state[x]+1] - arr[x][state[x]];
}
Result check(int a, int b){
if(st[a][a+1+(b!=-1)].empty() || (b!=-1 && st[b][b-1].empty())) return Result(0, 0, LLONG_MAX);
Result ret (0, 0, 0);
auto it = st[a][a+1+(b!=-1)].begin();
ret.A = it->x, ret.profit += it->v;
if(b!=-1){
it = st[b][b-1].begin();
ret.B = it->x, ret.profit += it->v;
}
return ret;
}
int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W){
n = N, s = X+1, e = Y+1, k = K;
for(int i=1; i<=n; i++) link[i].clear();
for(int i=0; i<n-1; i++){
link[U[i]+1].push_back(make_pair(V[i]+1, W[i]));
link[V[i]+1].push_back(make_pair(U[i]+1, W[i]));
}
dfs(s, -1, 0, sdist);
dfs(e, -1, 0, edist);
int ans = 0;
{
vector<ll> v;
for(int i=1; i<=n; i++) v.push_back(sdist[i]), v.push_back(edist[i]);
sort(v.begin(), v.end());
ll sum = 0;
for(int i=0; i<n*2; i++){
sum += v[i];
if(sum > K) break;
ans = i+1;
}
}
/// 이제는 따로 처리
ll se = sdist[e];
ll base = 0;
int baseCnt = 0;
for(int i=1; i<=n; i++){
if(sdist[i] + edist[i] != se){
v1[i] = min(sdist[i], edist[i]);
v2[i] = max(sdist[i], edist[i]) - v1[i];
}
else{
v1[i] = max(sdist[i], edist[i]) - min(sdist[i], edist[i]);
v2[i] = K+1;
base += min(sdist[i], edist[i]);
baseCnt++;
}
arr[i][0] = 0;
arr[i][1] = v1[i];
arr[i][2] = v1[i] + v2[i];
state[i] = 0;
// printf("%d: %lld %lld %lld\n", i, arr[i][0], arr[i][1], arr[i][2]);
}
if(base <= K){
K -= base;
// printf("base %d %lld\n", baseCnt, base);
for(int i=0; i<3; i++) for(int j=0; j<3; j++) st[i][j].clear();
for(int i=1; i<=n; i++){
update(i);
}
int ret = 0;
allSum = 0;
for(int turn=1; turn<=2*n; turn++){
Result tmp (0, 0, LLONG_MAX);
tmp = min(tmp, check(0, -1));
tmp = min(tmp, check(1, -1));
tmp = min(tmp, check(0, 1));
tmp = min(tmp, check(0, 2));
remove(tmp.A);
if(tmp.B) remove(tmp.B);
up(tmp.A);
if(tmp.B) down(tmp.B), up(tmp.A);
update(tmp.A);
if(tmp.B) update(tmp.B);
if(K < allSum) break;
ret++;
}
ans = max(ans, ret+baseCnt);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
119 ms |
34912 KB |
Output is correct |
2 |
Correct |
126 ms |
37604 KB |
Output is correct |
3 |
Correct |
69 ms |
7756 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4968 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4968 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
2 ms |
5008 KB |
Output is correct |
18 |
Correct |
4 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
5076 KB |
Output is correct |
20 |
Correct |
2 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
3 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4968 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
2 ms |
5008 KB |
Output is correct |
18 |
Correct |
4 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
5076 KB |
Output is correct |
20 |
Correct |
2 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
3 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
25 |
Correct |
6 ms |
5076 KB |
Output is correct |
26 |
Correct |
7 ms |
5844 KB |
Output is correct |
27 |
Correct |
5 ms |
5716 KB |
Output is correct |
28 |
Correct |
5 ms |
5844 KB |
Output is correct |
29 |
Correct |
5 ms |
5844 KB |
Output is correct |
30 |
Correct |
3 ms |
5460 KB |
Output is correct |
31 |
Correct |
3 ms |
5596 KB |
Output is correct |
32 |
Correct |
3 ms |
5588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
2 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
10 ms |
4972 KB |
Output is correct |
17 |
Correct |
2 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
2 ms |
4948 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
2 ms |
4948 KB |
Output is correct |
23 |
Correct |
2 ms |
4948 KB |
Output is correct |
24 |
Correct |
3 ms |
4948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4968 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
5008 KB |
Output is correct |
19 |
Correct |
2 ms |
4948 KB |
Output is correct |
20 |
Correct |
2 ms |
4948 KB |
Output is correct |
21 |
Correct |
2 ms |
4948 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
2 ms |
4948 KB |
Output is correct |
24 |
Correct |
3 ms |
4948 KB |
Output is correct |
25 |
Correct |
3 ms |
4948 KB |
Output is correct |
26 |
Correct |
2 ms |
4948 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
10 ms |
4972 KB |
Output is correct |
29 |
Correct |
2 ms |
4948 KB |
Output is correct |
30 |
Correct |
2 ms |
4948 KB |
Output is correct |
31 |
Correct |
3 ms |
4948 KB |
Output is correct |
32 |
Correct |
2 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
3 ms |
4948 KB |
Output is correct |
37 |
Correct |
2 ms |
4948 KB |
Output is correct |
38 |
Correct |
2 ms |
4948 KB |
Output is correct |
39 |
Correct |
2 ms |
4948 KB |
Output is correct |
40 |
Correct |
2 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
4948 KB |
Output is correct |
42 |
Correct |
2 ms |
4948 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
2 ms |
4948 KB |
Output is correct |
45 |
Correct |
2 ms |
4948 KB |
Output is correct |
46 |
Correct |
5 ms |
4948 KB |
Output is correct |
47 |
Correct |
2 ms |
4948 KB |
Output is correct |
48 |
Correct |
2 ms |
4948 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4968 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
5008 KB |
Output is correct |
19 |
Correct |
4 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
2 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
25 |
Correct |
3 ms |
5076 KB |
Output is correct |
26 |
Correct |
2 ms |
4948 KB |
Output is correct |
27 |
Correct |
2 ms |
4948 KB |
Output is correct |
28 |
Correct |
2 ms |
4948 KB |
Output is correct |
29 |
Correct |
3 ms |
4948 KB |
Output is correct |
30 |
Correct |
2 ms |
4948 KB |
Output is correct |
31 |
Correct |
3 ms |
4948 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
2 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
10 ms |
4972 KB |
Output is correct |
36 |
Correct |
2 ms |
4948 KB |
Output is correct |
37 |
Correct |
2 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
2 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
4948 KB |
Output is correct |
42 |
Correct |
2 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
2 ms |
4948 KB |
Output is correct |
45 |
Correct |
2 ms |
4948 KB |
Output is correct |
46 |
Correct |
2 ms |
4948 KB |
Output is correct |
47 |
Correct |
2 ms |
4948 KB |
Output is correct |
48 |
Correct |
2 ms |
4948 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
51 |
Correct |
2 ms |
4948 KB |
Output is correct |
52 |
Correct |
2 ms |
4948 KB |
Output is correct |
53 |
Correct |
5 ms |
4948 KB |
Output is correct |
54 |
Correct |
2 ms |
4948 KB |
Output is correct |
55 |
Correct |
2 ms |
4948 KB |
Output is correct |
56 |
Correct |
2 ms |
4948 KB |
Output is correct |
57 |
Correct |
2 ms |
4948 KB |
Output is correct |
58 |
Correct |
3 ms |
4948 KB |
Output is correct |
59 |
Correct |
3 ms |
5076 KB |
Output is correct |
60 |
Correct |
3 ms |
5076 KB |
Output is correct |
61 |
Correct |
2 ms |
5076 KB |
Output is correct |
62 |
Correct |
3 ms |
5076 KB |
Output is correct |
63 |
Correct |
3 ms |
5076 KB |
Output is correct |
64 |
Correct |
4 ms |
5076 KB |
Output is correct |
65 |
Correct |
2 ms |
5076 KB |
Output is correct |
66 |
Correct |
2 ms |
5076 KB |
Output is correct |
67 |
Correct |
2 ms |
5076 KB |
Output is correct |
68 |
Correct |
3 ms |
5076 KB |
Output is correct |
69 |
Correct |
3 ms |
5076 KB |
Output is correct |
70 |
Correct |
2 ms |
5076 KB |
Output is correct |
71 |
Correct |
2 ms |
5076 KB |
Output is correct |
72 |
Correct |
3 ms |
5076 KB |
Output is correct |
73 |
Correct |
3 ms |
5076 KB |
Output is correct |
74 |
Correct |
2 ms |
5076 KB |
Output is correct |
75 |
Correct |
3 ms |
5076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4968 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
5008 KB |
Output is correct |
19 |
Correct |
4 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
2 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
25 |
Correct |
3 ms |
5076 KB |
Output is correct |
26 |
Correct |
6 ms |
5076 KB |
Output is correct |
27 |
Correct |
7 ms |
5844 KB |
Output is correct |
28 |
Correct |
5 ms |
5716 KB |
Output is correct |
29 |
Correct |
5 ms |
5844 KB |
Output is correct |
30 |
Correct |
5 ms |
5844 KB |
Output is correct |
31 |
Correct |
3 ms |
5460 KB |
Output is correct |
32 |
Correct |
3 ms |
5596 KB |
Output is correct |
33 |
Correct |
3 ms |
5588 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
4948 KB |
Output is correct |
37 |
Correct |
3 ms |
4948 KB |
Output is correct |
38 |
Correct |
2 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
10 ms |
4972 KB |
Output is correct |
44 |
Correct |
2 ms |
4948 KB |
Output is correct |
45 |
Correct |
2 ms |
4948 KB |
Output is correct |
46 |
Correct |
3 ms |
4948 KB |
Output is correct |
47 |
Correct |
2 ms |
4948 KB |
Output is correct |
48 |
Correct |
3 ms |
4948 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
2 ms |
4948 KB |
Output is correct |
53 |
Correct |
2 ms |
4948 KB |
Output is correct |
54 |
Correct |
2 ms |
4948 KB |
Output is correct |
55 |
Correct |
2 ms |
4948 KB |
Output is correct |
56 |
Correct |
2 ms |
4948 KB |
Output is correct |
57 |
Correct |
2 ms |
4948 KB |
Output is correct |
58 |
Correct |
2 ms |
4948 KB |
Output is correct |
59 |
Correct |
2 ms |
4948 KB |
Output is correct |
60 |
Correct |
2 ms |
4948 KB |
Output is correct |
61 |
Correct |
5 ms |
4948 KB |
Output is correct |
62 |
Correct |
2 ms |
4948 KB |
Output is correct |
63 |
Correct |
2 ms |
4948 KB |
Output is correct |
64 |
Correct |
2 ms |
4948 KB |
Output is correct |
65 |
Correct |
2 ms |
4948 KB |
Output is correct |
66 |
Correct |
3 ms |
4948 KB |
Output is correct |
67 |
Correct |
3 ms |
5076 KB |
Output is correct |
68 |
Correct |
3 ms |
5076 KB |
Output is correct |
69 |
Correct |
2 ms |
5076 KB |
Output is correct |
70 |
Correct |
3 ms |
5076 KB |
Output is correct |
71 |
Correct |
3 ms |
5076 KB |
Output is correct |
72 |
Correct |
4 ms |
5076 KB |
Output is correct |
73 |
Correct |
2 ms |
5076 KB |
Output is correct |
74 |
Correct |
2 ms |
5076 KB |
Output is correct |
75 |
Correct |
2 ms |
5076 KB |
Output is correct |
76 |
Correct |
3 ms |
5076 KB |
Output is correct |
77 |
Correct |
3 ms |
5076 KB |
Output is correct |
78 |
Correct |
2 ms |
5076 KB |
Output is correct |
79 |
Correct |
2 ms |
5076 KB |
Output is correct |
80 |
Correct |
3 ms |
5076 KB |
Output is correct |
81 |
Correct |
3 ms |
5076 KB |
Output is correct |
82 |
Correct |
2 ms |
5076 KB |
Output is correct |
83 |
Correct |
3 ms |
5076 KB |
Output is correct |
84 |
Correct |
6 ms |
5076 KB |
Output is correct |
85 |
Correct |
4 ms |
5076 KB |
Output is correct |
86 |
Correct |
4 ms |
5076 KB |
Output is correct |
87 |
Correct |
4 ms |
5076 KB |
Output is correct |
88 |
Correct |
6 ms |
5076 KB |
Output is correct |
89 |
Correct |
13 ms |
5716 KB |
Output is correct |
90 |
Correct |
6 ms |
5716 KB |
Output is correct |
91 |
Correct |
5 ms |
5716 KB |
Output is correct |
92 |
Correct |
6 ms |
5716 KB |
Output is correct |
93 |
Correct |
4 ms |
5460 KB |
Output is correct |
94 |
Correct |
4 ms |
5844 KB |
Output is correct |
95 |
Correct |
5 ms |
5844 KB |
Output is correct |
96 |
Correct |
3 ms |
5588 KB |
Output is correct |
97 |
Correct |
6 ms |
5716 KB |
Output is correct |
98 |
Correct |
5 ms |
5716 KB |
Output is correct |
99 |
Correct |
6 ms |
5828 KB |
Output is correct |
100 |
Correct |
5 ms |
5588 KB |
Output is correct |
101 |
Correct |
5 ms |
5204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4968 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
2 ms |
4948 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
5008 KB |
Output is correct |
19 |
Correct |
4 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
2 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
25 |
Correct |
3 ms |
5076 KB |
Output is correct |
26 |
Correct |
6 ms |
5076 KB |
Output is correct |
27 |
Correct |
7 ms |
5844 KB |
Output is correct |
28 |
Correct |
5 ms |
5716 KB |
Output is correct |
29 |
Correct |
5 ms |
5844 KB |
Output is correct |
30 |
Correct |
5 ms |
5844 KB |
Output is correct |
31 |
Correct |
3 ms |
5460 KB |
Output is correct |
32 |
Correct |
3 ms |
5596 KB |
Output is correct |
33 |
Correct |
3 ms |
5588 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
4948 KB |
Output is correct |
37 |
Correct |
3 ms |
4948 KB |
Output is correct |
38 |
Correct |
2 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
10 ms |
4972 KB |
Output is correct |
44 |
Correct |
2 ms |
4948 KB |
Output is correct |
45 |
Correct |
2 ms |
4948 KB |
Output is correct |
46 |
Correct |
3 ms |
4948 KB |
Output is correct |
47 |
Correct |
2 ms |
4948 KB |
Output is correct |
48 |
Correct |
3 ms |
4948 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
2 ms |
4948 KB |
Output is correct |
53 |
Correct |
2 ms |
4948 KB |
Output is correct |
54 |
Correct |
2 ms |
4948 KB |
Output is correct |
55 |
Correct |
2 ms |
4948 KB |
Output is correct |
56 |
Correct |
2 ms |
4948 KB |
Output is correct |
57 |
Correct |
2 ms |
4948 KB |
Output is correct |
58 |
Correct |
2 ms |
4948 KB |
Output is correct |
59 |
Correct |
2 ms |
4948 KB |
Output is correct |
60 |
Correct |
2 ms |
4948 KB |
Output is correct |
61 |
Correct |
5 ms |
4948 KB |
Output is correct |
62 |
Correct |
2 ms |
4948 KB |
Output is correct |
63 |
Correct |
2 ms |
4948 KB |
Output is correct |
64 |
Correct |
2 ms |
4948 KB |
Output is correct |
65 |
Correct |
2 ms |
4948 KB |
Output is correct |
66 |
Correct |
3 ms |
4948 KB |
Output is correct |
67 |
Correct |
3 ms |
5076 KB |
Output is correct |
68 |
Correct |
3 ms |
5076 KB |
Output is correct |
69 |
Correct |
2 ms |
5076 KB |
Output is correct |
70 |
Correct |
3 ms |
5076 KB |
Output is correct |
71 |
Correct |
3 ms |
5076 KB |
Output is correct |
72 |
Correct |
4 ms |
5076 KB |
Output is correct |
73 |
Correct |
2 ms |
5076 KB |
Output is correct |
74 |
Correct |
2 ms |
5076 KB |
Output is correct |
75 |
Correct |
2 ms |
5076 KB |
Output is correct |
76 |
Correct |
3 ms |
5076 KB |
Output is correct |
77 |
Correct |
3 ms |
5076 KB |
Output is correct |
78 |
Correct |
2 ms |
5076 KB |
Output is correct |
79 |
Correct |
2 ms |
5076 KB |
Output is correct |
80 |
Correct |
3 ms |
5076 KB |
Output is correct |
81 |
Correct |
3 ms |
5076 KB |
Output is correct |
82 |
Correct |
2 ms |
5076 KB |
Output is correct |
83 |
Correct |
3 ms |
5076 KB |
Output is correct |
84 |
Correct |
6 ms |
5076 KB |
Output is correct |
85 |
Correct |
4 ms |
5076 KB |
Output is correct |
86 |
Correct |
4 ms |
5076 KB |
Output is correct |
87 |
Correct |
4 ms |
5076 KB |
Output is correct |
88 |
Correct |
6 ms |
5076 KB |
Output is correct |
89 |
Correct |
13 ms |
5716 KB |
Output is correct |
90 |
Correct |
6 ms |
5716 KB |
Output is correct |
91 |
Correct |
5 ms |
5716 KB |
Output is correct |
92 |
Correct |
6 ms |
5716 KB |
Output is correct |
93 |
Correct |
4 ms |
5460 KB |
Output is correct |
94 |
Correct |
4 ms |
5844 KB |
Output is correct |
95 |
Correct |
5 ms |
5844 KB |
Output is correct |
96 |
Correct |
3 ms |
5588 KB |
Output is correct |
97 |
Correct |
6 ms |
5716 KB |
Output is correct |
98 |
Correct |
5 ms |
5716 KB |
Output is correct |
99 |
Correct |
6 ms |
5828 KB |
Output is correct |
100 |
Correct |
5 ms |
5588 KB |
Output is correct |
101 |
Correct |
5 ms |
5204 KB |
Output is correct |
102 |
Correct |
173 ms |
7704 KB |
Output is correct |
103 |
Correct |
209 ms |
7608 KB |
Output is correct |
104 |
Correct |
458 ms |
61464 KB |
Output is correct |
105 |
Correct |
217 ms |
11904 KB |
Output is correct |
106 |
Correct |
188 ms |
10024 KB |
Output is correct |
107 |
Correct |
398 ms |
52768 KB |
Output is correct |
108 |
Correct |
336 ms |
53936 KB |
Output is correct |
109 |
Correct |
90 ms |
36576 KB |
Output is correct |
110 |
Correct |
395 ms |
58560 KB |
Output is correct |
111 |
Correct |
282 ms |
58272 KB |
Output is correct |
112 |
Correct |
316 ms |
57600 KB |
Output is correct |
113 |
Correct |
170 ms |
32264 KB |
Output is correct |
114 |
Correct |
375 ms |
56964 KB |
Output is correct |
115 |
Correct |
254 ms |
62148 KB |
Output is correct |
116 |
Correct |
379 ms |
57200 KB |
Output is correct |
117 |
Correct |
156 ms |
34748 KB |
Output is correct |
118 |
Correct |
392 ms |
58100 KB |
Output is correct |
119 |
Correct |
273 ms |
16440 KB |
Output is correct |
120 |
Correct |
199 ms |
8460 KB |
Output is correct |