#include"closing.h"
#include<vector>
#include<iostream>
#include<queue>
#include<set>
#include<algorithm>
#include<map>
using namespace std;
typedef __int128 ll;
int n,x,y;
ll k;
vector<pair<int,int>>nodes[200000];
ll distx[200000];
ll disty[200000];
void dfs1(int node,int par,ll*dists){
for(auto[ne,w]:nodes[node]){
if(ne==par)
continue;
dists[ne]=dists[node]+w;
dfs1(ne,node,dists);
}
}
int lvl1(){
vector<bool>vis(n);
int res=0;
ll kr=k;
priority_queue<pair<ll,int>>q;
q.push({0,x});
q.push({0,y});
vis[x]=true;
vis[y]=true;
while(q.size()){
int node=q.top().second;
ll cost=-q.top().first;
q.pop();
if(cost>kr)
break;
res++;
kr-=cost;
for(auto[ne,w]:nodes[node]){
if(vis[ne])
continue;
vis[ne]=true;
q.push({-min(distx[ne],disty[ne]),ne});
}
}
return res;
}
struct Tree{
vector<ll>tree;
int size;
Tree(int n){
size=1;
while(size<n)
size*=2;
tree=vector<ll>(2*size);
}
Tree()=default;
void upd(int i,ll x){
i+=size;
tree[i]=x;
while(i!=1){
i/=2;
tree[i]=tree[2*i]+tree[2*i+1];
}
}
int bound(int node,int rl,int rr,ll v){
if(rl==rr-1){
if(tree[node]<=v)
return rr;
return rl;
}
int mid=(rl+rr)/2;
if(tree[2*node]<=v){
return bound(2*node+1,mid,rr,v-tree[2*node]);
}else{
return bound(2*node,rl,mid,v);
}
}
ll sum(int node,int rl,int rr,int x){
if(rr<=x)
return tree[node];
if(x<=rl)
return 0;
int mid=(rl+rr)/2;
return sum(2*node,rl,mid,x)+sum(2*node+1,mid,rr,x);
}
int bound(ll v){
return bound(1,0,size,v);
}
ll sum(int x){
return sum(1,0,size,x);
}
};
struct Structure{
vector<ll>vec;
Tree tree;
Tree pres;
map<ll,int>mp;
void reg(ll a){
vec.push_back(a);
}
void init(){
sort(vec.begin(),vec.end());
tree=Tree((int)vec.size());
pres=Tree((int)vec.size());
for(int i=(int)vec.size()-1;i>=0;i--)
mp[vec[i]]=i;
}
int get(ll money){
return pres.sum(tree.bound(money));
}
void insert(ll a){
tree.upd(mp[a],vec[mp[a]]);
pres.upd(mp[a],1);
mp[a]++;
}
void remove(ll a){
mp[a]--;
tree.upd(mp[a],0);
pres.upd(mp[a],0);
}
};
int cmp(pair<ll,ll>a,pair<ll,ll>b){
return a.first+a.second<b.first+b.second;
}
int solve(vector<pair<ll,ll>>opts,ll money){
sort(opts.begin(),opts.end(),cmp);
Structure s;
for(auto[i,j]:opts){
s.reg(i);
s.reg(j);
}
s.init();
for(auto[i,j]:opts)
s.insert(i);
int res=s.get(money);
int res2=0;
for(auto[i,j]:opts){
money-=i;
s.remove(i);
s.insert(j);
res2++;
if(money<0)
break;
res=max(res,res2+s.get(money));
}
return res;
}
int lvl2(){
int cres=0;
ll money=k;
vector<pair<ll,ll>>opts;
for(int i=0;i<n;i++){
if(distx[i]+disty[i]==distx[y]){ // is on the path from x to y
cres++;
money-=min(distx[i],disty[i]);
opts.emplace_back(max(distx[i],disty[i])-min(distx[i],disty[i]),1e18);
}else{
opts.emplace_back(min(distx[i],disty[i]),max(distx[i],disty[i])-min(distx[i],disty[i]));
}
}
if(money<0)
return 0;
return cres+solve(opts,money);
}
int max_score(int N,int X,int Y,long long K,vector<int>U,vector<int>V,vector<int>W){
n=N;
x=X;
y=Y;
k=K;
for(int i=0;i<n;i++){
distx[i]=0;
disty[i]=0;
nodes[i].clear();
}
for(int i=0;i<n-1;i++){
nodes[U[i]].emplace_back(V[i],W[i]);
nodes[V[i]].emplace_back(U[i],W[i]);
}
dfs1(x,x,distx);
dfs1(y,y,disty);
return max(lvl1(),lvl2());
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
86 ms |
39248 KB |
Output is correct |
2 |
Correct |
99 ms |
44744 KB |
Output is correct |
3 |
Correct |
55 ms |
9296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
3 ms |
5212 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
2 ms |
4952 KB |
Output is correct |
11 |
Correct |
2 ms |
5152 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
3 ms |
5212 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
2 ms |
4952 KB |
Output is correct |
11 |
Correct |
2 ms |
5152 KB |
Output is correct |
12 |
Correct |
3 ms |
4952 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
3 ms |
5212 KB |
Output is correct |
20 |
Correct |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
3 ms |
5212 KB |
Output is correct |
22 |
Correct |
2 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
3 ms |
5212 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
2 ms |
4952 KB |
Output is correct |
11 |
Correct |
2 ms |
5152 KB |
Output is correct |
12 |
Correct |
3 ms |
4952 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
3 ms |
5212 KB |
Output is correct |
20 |
Correct |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
3 ms |
5212 KB |
Output is correct |
22 |
Correct |
2 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
4 ms |
5212 KB |
Output is correct |
26 |
Correct |
6 ms |
6436 KB |
Output is correct |
27 |
Correct |
5 ms |
6504 KB |
Output is correct |
28 |
Correct |
6 ms |
6492 KB |
Output is correct |
29 |
Correct |
6 ms |
6492 KB |
Output is correct |
30 |
Correct |
3 ms |
5724 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
3 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4988 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
2 ms |
5148 KB |
Output is correct |
11 |
Correct |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
3 ms |
5148 KB |
Output is correct |
18 |
Correct |
3 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
4956 KB |
Output is correct |
21 |
Correct |
3 ms |
5036 KB |
Output is correct |
22 |
Correct |
3 ms |
4956 KB |
Output is correct |
23 |
Correct |
3 ms |
4956 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
3 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
3 ms |
5212 KB |
Output is correct |
10 |
Correct |
2 ms |
4956 KB |
Output is correct |
11 |
Correct |
2 ms |
4952 KB |
Output is correct |
12 |
Correct |
2 ms |
5152 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
2 ms |
4988 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
5148 KB |
Output is correct |
23 |
Correct |
2 ms |
4956 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
3 ms |
4952 KB |
Output is correct |
26 |
Correct |
2 ms |
4956 KB |
Output is correct |
27 |
Correct |
2 ms |
4956 KB |
Output is correct |
28 |
Correct |
2 ms |
4956 KB |
Output is correct |
29 |
Correct |
3 ms |
5148 KB |
Output is correct |
30 |
Correct |
3 ms |
4956 KB |
Output is correct |
31 |
Correct |
2 ms |
4956 KB |
Output is correct |
32 |
Correct |
3 ms |
4956 KB |
Output is correct |
33 |
Correct |
3 ms |
5036 KB |
Output is correct |
34 |
Correct |
3 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
3 ms |
5152 KB |
Output is correct |
38 |
Correct |
4 ms |
5212 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
3 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
4956 KB |
Output is correct |
45 |
Correct |
3 ms |
4956 KB |
Output is correct |
46 |
Correct |
3 ms |
5148 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
4956 KB |
Output is correct |
49 |
Correct |
3 ms |
4956 KB |
Output is correct |
50 |
Correct |
3 ms |
4956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
3 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
3 ms |
5212 KB |
Output is correct |
10 |
Correct |
2 ms |
4956 KB |
Output is correct |
11 |
Correct |
2 ms |
4952 KB |
Output is correct |
12 |
Correct |
2 ms |
5152 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
3 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
2 ms |
4956 KB |
Output is correct |
27 |
Correct |
2 ms |
4988 KB |
Output is correct |
28 |
Correct |
2 ms |
4956 KB |
Output is correct |
29 |
Correct |
2 ms |
5148 KB |
Output is correct |
30 |
Correct |
2 ms |
4956 KB |
Output is correct |
31 |
Correct |
2 ms |
4956 KB |
Output is correct |
32 |
Correct |
3 ms |
4952 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4956 KB |
Output is correct |
36 |
Correct |
3 ms |
5148 KB |
Output is correct |
37 |
Correct |
3 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
3 ms |
4956 KB |
Output is correct |
40 |
Correct |
3 ms |
5036 KB |
Output is correct |
41 |
Correct |
3 ms |
4956 KB |
Output is correct |
42 |
Correct |
3 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
5152 KB |
Output is correct |
45 |
Correct |
4 ms |
5212 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
51 |
Correct |
3 ms |
4956 KB |
Output is correct |
52 |
Correct |
3 ms |
4956 KB |
Output is correct |
53 |
Correct |
3 ms |
5148 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
3 ms |
4956 KB |
Output is correct |
56 |
Correct |
3 ms |
4956 KB |
Output is correct |
57 |
Correct |
3 ms |
4956 KB |
Output is correct |
58 |
Correct |
4 ms |
4952 KB |
Output is correct |
59 |
Correct |
3 ms |
4956 KB |
Output is correct |
60 |
Correct |
3 ms |
4956 KB |
Output is correct |
61 |
Correct |
3 ms |
5212 KB |
Output is correct |
62 |
Correct |
3 ms |
5212 KB |
Output is correct |
63 |
Correct |
4 ms |
5212 KB |
Output is correct |
64 |
Correct |
4 ms |
5208 KB |
Output is correct |
65 |
Correct |
3 ms |
5212 KB |
Output is correct |
66 |
Correct |
3 ms |
5212 KB |
Output is correct |
67 |
Correct |
2 ms |
5212 KB |
Output is correct |
68 |
Correct |
3 ms |
5208 KB |
Output is correct |
69 |
Correct |
3 ms |
5356 KB |
Output is correct |
70 |
Correct |
2 ms |
5212 KB |
Output is correct |
71 |
Correct |
4 ms |
5156 KB |
Output is correct |
72 |
Correct |
4 ms |
5312 KB |
Output is correct |
73 |
Correct |
4 ms |
5212 KB |
Output is correct |
74 |
Correct |
3 ms |
5212 KB |
Output is correct |
75 |
Correct |
3 ms |
5212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
3 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
3 ms |
5212 KB |
Output is correct |
10 |
Correct |
2 ms |
4956 KB |
Output is correct |
11 |
Correct |
2 ms |
4952 KB |
Output is correct |
12 |
Correct |
2 ms |
5152 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
3 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
4 ms |
5212 KB |
Output is correct |
27 |
Correct |
6 ms |
6436 KB |
Output is correct |
28 |
Correct |
5 ms |
6504 KB |
Output is correct |
29 |
Correct |
6 ms |
6492 KB |
Output is correct |
30 |
Correct |
6 ms |
6492 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5724 KB |
Output is correct |
33 |
Correct |
3 ms |
5724 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4988 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
5148 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
3 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
5148 KB |
Output is correct |
45 |
Correct |
3 ms |
4956 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
3 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
5036 KB |
Output is correct |
49 |
Correct |
3 ms |
4956 KB |
Output is correct |
50 |
Correct |
3 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
3 ms |
5152 KB |
Output is correct |
53 |
Correct |
4 ms |
5212 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
2 ms |
4956 KB |
Output is correct |
56 |
Correct |
3 ms |
4956 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
2 ms |
4956 KB |
Output is correct |
59 |
Correct |
3 ms |
4956 KB |
Output is correct |
60 |
Correct |
3 ms |
4956 KB |
Output is correct |
61 |
Correct |
3 ms |
5148 KB |
Output is correct |
62 |
Correct |
2 ms |
4956 KB |
Output is correct |
63 |
Correct |
3 ms |
4956 KB |
Output is correct |
64 |
Correct |
3 ms |
4956 KB |
Output is correct |
65 |
Correct |
3 ms |
4956 KB |
Output is correct |
66 |
Correct |
4 ms |
4952 KB |
Output is correct |
67 |
Correct |
3 ms |
4956 KB |
Output is correct |
68 |
Correct |
3 ms |
4956 KB |
Output is correct |
69 |
Correct |
3 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
4 ms |
5212 KB |
Output is correct |
72 |
Correct |
4 ms |
5208 KB |
Output is correct |
73 |
Correct |
3 ms |
5212 KB |
Output is correct |
74 |
Correct |
3 ms |
5212 KB |
Output is correct |
75 |
Correct |
2 ms |
5212 KB |
Output is correct |
76 |
Correct |
3 ms |
5208 KB |
Output is correct |
77 |
Correct |
3 ms |
5356 KB |
Output is correct |
78 |
Correct |
2 ms |
5212 KB |
Output is correct |
79 |
Correct |
4 ms |
5156 KB |
Output is correct |
80 |
Correct |
4 ms |
5312 KB |
Output is correct |
81 |
Correct |
4 ms |
5212 KB |
Output is correct |
82 |
Correct |
3 ms |
5212 KB |
Output is correct |
83 |
Correct |
3 ms |
5212 KB |
Output is correct |
84 |
Correct |
4 ms |
5192 KB |
Output is correct |
85 |
Correct |
4 ms |
5212 KB |
Output is correct |
86 |
Correct |
5 ms |
5160 KB |
Output is correct |
87 |
Correct |
5 ms |
5212 KB |
Output is correct |
88 |
Correct |
6 ms |
5320 KB |
Output is correct |
89 |
Correct |
7 ms |
6504 KB |
Output is correct |
90 |
Correct |
6 ms |
6456 KB |
Output is correct |
91 |
Correct |
7 ms |
6492 KB |
Output is correct |
92 |
Correct |
5 ms |
6236 KB |
Output is correct |
93 |
Correct |
5 ms |
5668 KB |
Output is correct |
94 |
Correct |
7 ms |
6484 KB |
Output is correct |
95 |
Correct |
8 ms |
6492 KB |
Output is correct |
96 |
Correct |
4 ms |
5724 KB |
Output is correct |
97 |
Correct |
9 ms |
6748 KB |
Output is correct |
98 |
Correct |
7 ms |
6236 KB |
Output is correct |
99 |
Correct |
6 ms |
6232 KB |
Output is correct |
100 |
Correct |
6 ms |
6236 KB |
Output is correct |
101 |
Correct |
5 ms |
5212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
3 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
3 ms |
5212 KB |
Output is correct |
10 |
Correct |
2 ms |
4956 KB |
Output is correct |
11 |
Correct |
2 ms |
4952 KB |
Output is correct |
12 |
Correct |
2 ms |
5152 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
3 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
4 ms |
5212 KB |
Output is correct |
27 |
Correct |
6 ms |
6436 KB |
Output is correct |
28 |
Correct |
5 ms |
6504 KB |
Output is correct |
29 |
Correct |
6 ms |
6492 KB |
Output is correct |
30 |
Correct |
6 ms |
6492 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5724 KB |
Output is correct |
33 |
Correct |
3 ms |
5724 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4988 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
5148 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
3 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
5148 KB |
Output is correct |
45 |
Correct |
3 ms |
4956 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
3 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
5036 KB |
Output is correct |
49 |
Correct |
3 ms |
4956 KB |
Output is correct |
50 |
Correct |
3 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
3 ms |
5152 KB |
Output is correct |
53 |
Correct |
4 ms |
5212 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
2 ms |
4956 KB |
Output is correct |
56 |
Correct |
3 ms |
4956 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
2 ms |
4956 KB |
Output is correct |
59 |
Correct |
3 ms |
4956 KB |
Output is correct |
60 |
Correct |
3 ms |
4956 KB |
Output is correct |
61 |
Correct |
3 ms |
5148 KB |
Output is correct |
62 |
Correct |
2 ms |
4956 KB |
Output is correct |
63 |
Correct |
3 ms |
4956 KB |
Output is correct |
64 |
Correct |
3 ms |
4956 KB |
Output is correct |
65 |
Correct |
3 ms |
4956 KB |
Output is correct |
66 |
Correct |
4 ms |
4952 KB |
Output is correct |
67 |
Correct |
3 ms |
4956 KB |
Output is correct |
68 |
Correct |
3 ms |
4956 KB |
Output is correct |
69 |
Correct |
3 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
4 ms |
5212 KB |
Output is correct |
72 |
Correct |
4 ms |
5208 KB |
Output is correct |
73 |
Correct |
3 ms |
5212 KB |
Output is correct |
74 |
Correct |
3 ms |
5212 KB |
Output is correct |
75 |
Correct |
2 ms |
5212 KB |
Output is correct |
76 |
Correct |
3 ms |
5208 KB |
Output is correct |
77 |
Correct |
3 ms |
5356 KB |
Output is correct |
78 |
Correct |
2 ms |
5212 KB |
Output is correct |
79 |
Correct |
4 ms |
5156 KB |
Output is correct |
80 |
Correct |
4 ms |
5312 KB |
Output is correct |
81 |
Correct |
4 ms |
5212 KB |
Output is correct |
82 |
Correct |
3 ms |
5212 KB |
Output is correct |
83 |
Correct |
3 ms |
5212 KB |
Output is correct |
84 |
Correct |
4 ms |
5192 KB |
Output is correct |
85 |
Correct |
4 ms |
5212 KB |
Output is correct |
86 |
Correct |
5 ms |
5160 KB |
Output is correct |
87 |
Correct |
5 ms |
5212 KB |
Output is correct |
88 |
Correct |
6 ms |
5320 KB |
Output is correct |
89 |
Correct |
7 ms |
6504 KB |
Output is correct |
90 |
Correct |
6 ms |
6456 KB |
Output is correct |
91 |
Correct |
7 ms |
6492 KB |
Output is correct |
92 |
Correct |
5 ms |
6236 KB |
Output is correct |
93 |
Correct |
5 ms |
5668 KB |
Output is correct |
94 |
Correct |
7 ms |
6484 KB |
Output is correct |
95 |
Correct |
8 ms |
6492 KB |
Output is correct |
96 |
Correct |
4 ms |
5724 KB |
Output is correct |
97 |
Correct |
9 ms |
6748 KB |
Output is correct |
98 |
Correct |
7 ms |
6236 KB |
Output is correct |
99 |
Correct |
6 ms |
6232 KB |
Output is correct |
100 |
Correct |
6 ms |
6236 KB |
Output is correct |
101 |
Correct |
5 ms |
5212 KB |
Output is correct |
102 |
Correct |
147 ms |
10240 KB |
Output is correct |
103 |
Correct |
139 ms |
10508 KB |
Output is correct |
104 |
Correct |
547 ms |
101920 KB |
Output is correct |
105 |
Correct |
173 ms |
15040 KB |
Output is correct |
106 |
Correct |
230 ms |
13380 KB |
Output is correct |
107 |
Correct |
191 ms |
74792 KB |
Output is correct |
108 |
Correct |
177 ms |
75904 KB |
Output is correct |
109 |
Correct |
66 ms |
46276 KB |
Output is correct |
110 |
Correct |
423 ms |
94648 KB |
Output is correct |
111 |
Correct |
395 ms |
99148 KB |
Output is correct |
112 |
Correct |
286 ms |
93652 KB |
Output is correct |
113 |
Correct |
124 ms |
34564 KB |
Output is correct |
114 |
Correct |
266 ms |
81480 KB |
Output is correct |
115 |
Correct |
338 ms |
98396 KB |
Output is correct |
116 |
Correct |
369 ms |
95432 KB |
Output is correct |
117 |
Correct |
146 ms |
40160 KB |
Output is correct |
118 |
Correct |
426 ms |
94336 KB |
Output is correct |
119 |
Correct |
216 ms |
21216 KB |
Output is correct |
120 |
Correct |
127 ms |
9868 KB |
Output is correct |