#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
int Type[200003];
int Check[200003];
int BFSCheck[200003];
long long Cost1[200003];
long long Cost2[200003];
long long dp[5003][10003];
int CPrev[200003];
long long DistX[200003];
long long DistY[200003];
int check[200003];
vector <int> VOrder1;
vector <int> VOrder2;
long long N,X,Y,K,n,ans1,ans2;
struct edge{
int first;
long long second;
};
vector <edge> VTemp;
vector <vector <edge> > adj;
vector <int> XYPath;
priority_queue <pair <long long,int> > pq1,pq2,pq3,pq4;
int max_score(int N, int X, int Y, long long K, std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
int n=N;
int x=X;
int y=Y;
long long k=K;
int q,s,e;
long long tans,Budget,len;
vector <int> CList;
int cur,cur2;
int t;
long long t2;
pair <long long,int> tpos;
while(!pq1.empty()){
pq1.pop();
}
while(!pq2.empty()){
pq2.pop();
}
while(!pq3.empty()){
pq3.pop();
}
while(!pq4.empty()){
pq4.pop();
}
XYPath.clear();
adj.clear();
n=N;
for(int i=0;i<=n+1;i++){
adj.push_back(VTemp);
check[i]=0;
Cost1[i]=0;
Cost2[i]=0;
DistX[i]=0;
DistY[i]=0;
Type[i]=0;
}
ans1=0;
ans2=0;
for(int i=1;i<n;i++){
s=U[i-1];
e=V[i-1];
len=W[i-1];
adj[s].push_back({e,len});
adj[e].push_back({s,len});
}
CList.clear();
cur=0;
cur2=0;
for(int i=0;i<=n+1;i++){
BFSCheck[i]=0;
CPrev[i]=0;
}
CList.push_back(X);
BFSCheck[X]=1;
DistX[X]=0;
CPrev[X]=-1;
while(cur<CList.size()){
t=CList[cur];
for(int i=0;i<adj[t].size();i++){
if(BFSCheck[adj[t][i].first]==0){
BFSCheck[adj[t][i].first]=1;
DistX[adj[t][i].first]=DistX[t]+adj[t][i].second;
CPrev[adj[t][i].first]=t;
CList.push_back(adj[t][i].first);
if(adj[t][i].first==Y){
XYPath.push_back(Y);
cur2=Y;
while(CPrev[cur2]>=0){
cur2=CPrev[cur2];
XYPath.push_back(cur2);
}
}
}
}
cur++;
}
CList.clear();
cur=0;
cur2=0;
for(int i=0;i<=n+1;i++){
BFSCheck[i]=0;
CPrev[i]=0;
}
CList.push_back(Y);
BFSCheck[Y]=1;
DistY[Y]=0;
while(cur<CList.size()){
t=CList[cur];
for(int i=0;i<adj[t].size();i++){
if(BFSCheck[adj[t][i].first]==0){
BFSCheck[adj[t][i].first]=1;
DistY[adj[t][i].first]=DistY[t]+adj[t][i].second;
CList.push_back(adj[t][i].first);
}
}
cur++;
}
for(int i=0;i<n;i++){
Cost1[i]=min(DistX[i],DistY[i]);
Cost2[i]=max(DistX[i],DistY[i])-Cost1[i];
if(Cost2[i]<=Cost1[i]){
Type[i]=1;
}
}
for(int i=0;i<XYPath.size();i++){
Type[XYPath[i]]=2;
}
for(int i=0;i<n;i++){
pq4.push({-Cost1[i],i});
}
Budget=K;
while(Budget>0&&!pq4.empty()){
Budget+=pq4.top().first;
if(Budget>=0){
ans1++;
VOrder1.push_back(pq4.top().second);
pq4.pop();
}
}
Budget=K;
for(int i=0;i<XYPath.size();i++){
Budget-=Cost1[XYPath[i]];
check[XYPath[i]]=1;
ans2++;
VOrder2.push_back(XYPath[i]);
}
tans=ans1;
if(Budget>0){
for(int i=0;i<n;i++){
if(Type[i]==0){
pq1.push({-Cost1[i],i});
pq1.push({-Cost2[i],i});
}else if(Type[i]==1){
pq2.push({-(Cost1[i]+Cost2[i]),i});
pq3.push({-Cost1[i],i});
}else{
pq1.push({-Cost2[i],i});
}
}
while(!pq2.empty()&&Budget+pq2.top().first>=0){
if(pq1.size() <=1){
Budget+=pq2.top().first;
if(Budget>=0){
check[pq2.top().second]=2;
pq2.pop();
ans2+=2;
VOrder2.push_back(pq2.top().second);
continue;
}
}
tpos=pq1.top();
pq1.pop();
if(pq1.top().first+tpos.first> pq2.top().first&&Budget+tpos.first>=0){
Budget+=(tpos.first);
ans2+=1;
check[tpos.second]++;
VOrder2.push_back(tpos.second);
}else if(pq2.top().first+Budget>=0){
Budget+=pq2.top().first;
pq1.push(tpos);
ans2+=2;
check[pq2.top().second]=2;
VOrder2.push_back(pq2.top().second);
VOrder2.push_back(pq2.top().second);
pq2.pop();
}
}
while(!pq1.empty()&&Budget+pq1.top().first>=0){
Budget+=pq1.top().first;
ans2++;
check[pq1.top().second]++;
VOrder2.push_back(pq1.top().second);
pq1.pop();
}
while(!pq3.empty()&&check[pq3.top().second]!=0){
pq3.pop();
}
if(!pq3.empty()&&pq3.top().first+Budget>=0){
ans2++;
check[pq3.top().second]=1;
VOrder2.push_back(pq3.top().second);
}
tans=max(ans1,ans2);
}
return tans;
}
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:82:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
82 | while(cur<CList.size()){
| ~~~^~~~~~~~~~~~~
closing.cpp:84:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
84 | for(int i=0;i<adj[t].size();i++){
| ~^~~~~~~~~~~~~~
closing.cpp:112:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
112 | while(cur<CList.size()){
| ~~~^~~~~~~~~~~~~
closing.cpp:114:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
114 | for(int i=0;i<adj[t].size();i++){
| ~^~~~~~~~~~~~~~
closing.cpp:130:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
130 | for(int i=0;i<XYPath.size();i++){
| ~^~~~~~~~~~~~~~
closing.cpp:146:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
146 | for(int i=0;i<XYPath.size();i++){
| ~^~~~~~~~~~~~~~
closing.cpp:28:6: warning: unused variable 'x' [-Wunused-variable]
28 | int x=X;
| ^
closing.cpp:29:6: warning: unused variable 'y' [-Wunused-variable]
29 | int y=Y;
| ^
closing.cpp:30:12: warning: unused variable 'k' [-Wunused-variable]
30 | long long k=K;
| ^
closing.cpp:31:6: warning: unused variable 'q' [-Wunused-variable]
31 | int q,s,e;
| ^
closing.cpp:36:12: warning: unused variable 't2' [-Wunused-variable]
36 | long long t2;
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
101 ms |
43708 KB |
Output is correct |
2 |
Correct |
128 ms |
44732 KB |
Output is correct |
3 |
Correct |
79 ms |
14340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8536 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
8644 KB |
Output is correct |
8 |
Correct |
1 ms |
8536 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8536 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
8644 KB |
Output is correct |
8 |
Correct |
1 ms |
8536 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8536 KB |
Output is correct |
16 |
Correct |
1 ms |
8636 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8540 KB |
Output is correct |
19 |
Correct |
1 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8736 KB |
Output is correct |
21 |
Correct |
1 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
2 ms |
8536 KB |
Output is correct |
24 |
Correct |
2 ms |
8644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8536 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
8644 KB |
Output is correct |
8 |
Correct |
1 ms |
8536 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8536 KB |
Output is correct |
16 |
Correct |
1 ms |
8636 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8540 KB |
Output is correct |
19 |
Correct |
1 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8736 KB |
Output is correct |
21 |
Correct |
1 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
2 ms |
8536 KB |
Output is correct |
24 |
Correct |
2 ms |
8644 KB |
Output is correct |
25 |
Correct |
3 ms |
8796 KB |
Output is correct |
26 |
Correct |
3 ms |
9232 KB |
Output is correct |
27 |
Correct |
3 ms |
9308 KB |
Output is correct |
28 |
Correct |
3 ms |
9052 KB |
Output is correct |
29 |
Correct |
3 ms |
9016 KB |
Output is correct |
30 |
Correct |
2 ms |
9048 KB |
Output is correct |
31 |
Correct |
2 ms |
9052 KB |
Output is correct |
32 |
Correct |
3 ms |
9304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
1 ms |
8644 KB |
Output is correct |
8 |
Correct |
1 ms |
8536 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
2 ms |
8640 KB |
Output is correct |
13 |
Correct |
1 ms |
8588 KB |
Output is correct |
14 |
Correct |
1 ms |
8536 KB |
Output is correct |
15 |
Correct |
2 ms |
8656 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8640 KB |
Output is correct |
18 |
Correct |
1 ms |
8636 KB |
Output is correct |
19 |
Correct |
1 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8640 KB |
Output is correct |
21 |
Correct |
2 ms |
8536 KB |
Output is correct |
22 |
Correct |
1 ms |
8536 KB |
Output is correct |
23 |
Correct |
2 ms |
8540 KB |
Output is correct |
24 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
1 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8644 KB |
Output is correct |
9 |
Correct |
1 ms |
8536 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8536 KB |
Output is correct |
17 |
Correct |
1 ms |
8636 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
1 ms |
8644 KB |
Output is correct |
20 |
Correct |
1 ms |
8536 KB |
Output is correct |
21 |
Correct |
1 ms |
8540 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
8540 KB |
Output is correct |
24 |
Correct |
2 ms |
8640 KB |
Output is correct |
25 |
Correct |
1 ms |
8588 KB |
Output is correct |
26 |
Correct |
1 ms |
8536 KB |
Output is correct |
27 |
Correct |
2 ms |
8656 KB |
Output is correct |
28 |
Correct |
1 ms |
8540 KB |
Output is correct |
29 |
Correct |
1 ms |
8640 KB |
Output is correct |
30 |
Correct |
1 ms |
8636 KB |
Output is correct |
31 |
Correct |
1 ms |
8540 KB |
Output is correct |
32 |
Correct |
1 ms |
8640 KB |
Output is correct |
33 |
Correct |
2 ms |
8536 KB |
Output is correct |
34 |
Correct |
1 ms |
8536 KB |
Output is correct |
35 |
Correct |
2 ms |
8540 KB |
Output is correct |
36 |
Correct |
1 ms |
8540 KB |
Output is correct |
37 |
Correct |
1 ms |
8540 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
2 ms |
8540 KB |
Output is correct |
40 |
Correct |
1 ms |
8540 KB |
Output is correct |
41 |
Correct |
1 ms |
8540 KB |
Output is correct |
42 |
Correct |
2 ms |
8640 KB |
Output is correct |
43 |
Correct |
1 ms |
8540 KB |
Output is correct |
44 |
Correct |
2 ms |
8540 KB |
Output is correct |
45 |
Correct |
2 ms |
8540 KB |
Output is correct |
46 |
Correct |
1 ms |
8544 KB |
Output is correct |
47 |
Correct |
3 ms |
8540 KB |
Output is correct |
48 |
Correct |
1 ms |
8540 KB |
Output is correct |
49 |
Correct |
2 ms |
8540 KB |
Output is correct |
50 |
Correct |
1 ms |
8644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
1 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8644 KB |
Output is correct |
9 |
Correct |
1 ms |
8536 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8536 KB |
Output is correct |
17 |
Correct |
1 ms |
8636 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8540 KB |
Output is correct |
21 |
Correct |
1 ms |
8736 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
2 ms |
8540 KB |
Output is correct |
24 |
Correct |
2 ms |
8536 KB |
Output is correct |
25 |
Correct |
2 ms |
8644 KB |
Output is correct |
26 |
Correct |
1 ms |
8644 KB |
Output is correct |
27 |
Correct |
1 ms |
8536 KB |
Output is correct |
28 |
Correct |
1 ms |
8540 KB |
Output is correct |
29 |
Correct |
1 ms |
8540 KB |
Output is correct |
30 |
Correct |
1 ms |
8540 KB |
Output is correct |
31 |
Correct |
2 ms |
8640 KB |
Output is correct |
32 |
Correct |
1 ms |
8588 KB |
Output is correct |
33 |
Correct |
1 ms |
8536 KB |
Output is correct |
34 |
Correct |
2 ms |
8656 KB |
Output is correct |
35 |
Correct |
1 ms |
8540 KB |
Output is correct |
36 |
Correct |
1 ms |
8640 KB |
Output is correct |
37 |
Correct |
1 ms |
8636 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
1 ms |
8640 KB |
Output is correct |
40 |
Correct |
2 ms |
8536 KB |
Output is correct |
41 |
Correct |
1 ms |
8536 KB |
Output is correct |
42 |
Correct |
2 ms |
8540 KB |
Output is correct |
43 |
Correct |
1 ms |
8540 KB |
Output is correct |
44 |
Correct |
1 ms |
8540 KB |
Output is correct |
45 |
Correct |
1 ms |
8540 KB |
Output is correct |
46 |
Correct |
2 ms |
8540 KB |
Output is correct |
47 |
Correct |
1 ms |
8540 KB |
Output is correct |
48 |
Correct |
1 ms |
8540 KB |
Output is correct |
49 |
Correct |
2 ms |
8640 KB |
Output is correct |
50 |
Correct |
1 ms |
8540 KB |
Output is correct |
51 |
Correct |
2 ms |
8540 KB |
Output is correct |
52 |
Correct |
2 ms |
8540 KB |
Output is correct |
53 |
Correct |
1 ms |
8544 KB |
Output is correct |
54 |
Correct |
3 ms |
8540 KB |
Output is correct |
55 |
Correct |
1 ms |
8540 KB |
Output is correct |
56 |
Correct |
2 ms |
8540 KB |
Output is correct |
57 |
Correct |
1 ms |
8644 KB |
Output is correct |
58 |
Correct |
1 ms |
8540 KB |
Output is correct |
59 |
Correct |
1 ms |
8644 KB |
Output is correct |
60 |
Correct |
1 ms |
8540 KB |
Output is correct |
61 |
Correct |
2 ms |
8540 KB |
Output is correct |
62 |
Correct |
1 ms |
8540 KB |
Output is correct |
63 |
Correct |
2 ms |
8656 KB |
Output is correct |
64 |
Correct |
2 ms |
8540 KB |
Output is correct |
65 |
Correct |
1 ms |
8540 KB |
Output is correct |
66 |
Correct |
1 ms |
8540 KB |
Output is correct |
67 |
Correct |
1 ms |
8540 KB |
Output is correct |
68 |
Correct |
1 ms |
8540 KB |
Output is correct |
69 |
Correct |
1 ms |
8544 KB |
Output is correct |
70 |
Correct |
2 ms |
8540 KB |
Output is correct |
71 |
Correct |
1 ms |
8540 KB |
Output is correct |
72 |
Correct |
2 ms |
8540 KB |
Output is correct |
73 |
Correct |
1 ms |
8540 KB |
Output is correct |
74 |
Correct |
2 ms |
8540 KB |
Output is correct |
75 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
1 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8644 KB |
Output is correct |
9 |
Correct |
1 ms |
8536 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8536 KB |
Output is correct |
17 |
Correct |
1 ms |
8636 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8540 KB |
Output is correct |
21 |
Correct |
1 ms |
8736 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
2 ms |
8540 KB |
Output is correct |
24 |
Correct |
2 ms |
8536 KB |
Output is correct |
25 |
Correct |
2 ms |
8644 KB |
Output is correct |
26 |
Correct |
3 ms |
8796 KB |
Output is correct |
27 |
Correct |
3 ms |
9232 KB |
Output is correct |
28 |
Correct |
3 ms |
9308 KB |
Output is correct |
29 |
Correct |
3 ms |
9052 KB |
Output is correct |
30 |
Correct |
3 ms |
9016 KB |
Output is correct |
31 |
Correct |
2 ms |
9048 KB |
Output is correct |
32 |
Correct |
2 ms |
9052 KB |
Output is correct |
33 |
Correct |
3 ms |
9304 KB |
Output is correct |
34 |
Correct |
1 ms |
8644 KB |
Output is correct |
35 |
Correct |
1 ms |
8536 KB |
Output is correct |
36 |
Correct |
1 ms |
8540 KB |
Output is correct |
37 |
Correct |
1 ms |
8540 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
2 ms |
8640 KB |
Output is correct |
40 |
Correct |
1 ms |
8588 KB |
Output is correct |
41 |
Correct |
1 ms |
8536 KB |
Output is correct |
42 |
Correct |
2 ms |
8656 KB |
Output is correct |
43 |
Correct |
1 ms |
8540 KB |
Output is correct |
44 |
Correct |
1 ms |
8640 KB |
Output is correct |
45 |
Correct |
1 ms |
8636 KB |
Output is correct |
46 |
Correct |
1 ms |
8540 KB |
Output is correct |
47 |
Correct |
1 ms |
8640 KB |
Output is correct |
48 |
Correct |
2 ms |
8536 KB |
Output is correct |
49 |
Correct |
1 ms |
8536 KB |
Output is correct |
50 |
Correct |
2 ms |
8540 KB |
Output is correct |
51 |
Correct |
1 ms |
8540 KB |
Output is correct |
52 |
Correct |
1 ms |
8540 KB |
Output is correct |
53 |
Correct |
1 ms |
8540 KB |
Output is correct |
54 |
Correct |
2 ms |
8540 KB |
Output is correct |
55 |
Correct |
1 ms |
8540 KB |
Output is correct |
56 |
Correct |
1 ms |
8540 KB |
Output is correct |
57 |
Correct |
2 ms |
8640 KB |
Output is correct |
58 |
Correct |
1 ms |
8540 KB |
Output is correct |
59 |
Correct |
2 ms |
8540 KB |
Output is correct |
60 |
Correct |
2 ms |
8540 KB |
Output is correct |
61 |
Correct |
1 ms |
8544 KB |
Output is correct |
62 |
Correct |
3 ms |
8540 KB |
Output is correct |
63 |
Correct |
1 ms |
8540 KB |
Output is correct |
64 |
Correct |
2 ms |
8540 KB |
Output is correct |
65 |
Correct |
1 ms |
8644 KB |
Output is correct |
66 |
Correct |
1 ms |
8540 KB |
Output is correct |
67 |
Correct |
1 ms |
8644 KB |
Output is correct |
68 |
Correct |
1 ms |
8540 KB |
Output is correct |
69 |
Correct |
2 ms |
8540 KB |
Output is correct |
70 |
Correct |
1 ms |
8540 KB |
Output is correct |
71 |
Correct |
2 ms |
8656 KB |
Output is correct |
72 |
Correct |
2 ms |
8540 KB |
Output is correct |
73 |
Correct |
1 ms |
8540 KB |
Output is correct |
74 |
Correct |
1 ms |
8540 KB |
Output is correct |
75 |
Correct |
1 ms |
8540 KB |
Output is correct |
76 |
Correct |
1 ms |
8540 KB |
Output is correct |
77 |
Correct |
1 ms |
8544 KB |
Output is correct |
78 |
Correct |
2 ms |
8540 KB |
Output is correct |
79 |
Correct |
1 ms |
8540 KB |
Output is correct |
80 |
Correct |
2 ms |
8540 KB |
Output is correct |
81 |
Correct |
1 ms |
8540 KB |
Output is correct |
82 |
Correct |
2 ms |
8540 KB |
Output is correct |
83 |
Correct |
1 ms |
8540 KB |
Output is correct |
84 |
Correct |
3 ms |
8796 KB |
Output is correct |
85 |
Correct |
3 ms |
8792 KB |
Output is correct |
86 |
Correct |
3 ms |
8796 KB |
Output is correct |
87 |
Correct |
3 ms |
8800 KB |
Output is correct |
88 |
Correct |
3 ms |
8800 KB |
Output is correct |
89 |
Correct |
3 ms |
9168 KB |
Output is correct |
90 |
Correct |
3 ms |
9164 KB |
Output is correct |
91 |
Correct |
3 ms |
9312 KB |
Output is correct |
92 |
Correct |
2 ms |
9052 KB |
Output is correct |
93 |
Correct |
2 ms |
9052 KB |
Output is correct |
94 |
Correct |
2 ms |
9052 KB |
Output is correct |
95 |
Correct |
3 ms |
9216 KB |
Output is correct |
96 |
Correct |
2 ms |
9052 KB |
Output is correct |
97 |
Correct |
3 ms |
9052 KB |
Output is correct |
98 |
Correct |
3 ms |
9168 KB |
Output is correct |
99 |
Correct |
3 ms |
9052 KB |
Output is correct |
100 |
Correct |
3 ms |
9052 KB |
Output is correct |
101 |
Correct |
3 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
1 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8644 KB |
Output is correct |
9 |
Correct |
1 ms |
8536 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8536 KB |
Output is correct |
17 |
Correct |
1 ms |
8636 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8540 KB |
Output is correct |
21 |
Correct |
1 ms |
8736 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
2 ms |
8540 KB |
Output is correct |
24 |
Correct |
2 ms |
8536 KB |
Output is correct |
25 |
Correct |
2 ms |
8644 KB |
Output is correct |
26 |
Correct |
3 ms |
8796 KB |
Output is correct |
27 |
Correct |
3 ms |
9232 KB |
Output is correct |
28 |
Correct |
3 ms |
9308 KB |
Output is correct |
29 |
Correct |
3 ms |
9052 KB |
Output is correct |
30 |
Correct |
3 ms |
9016 KB |
Output is correct |
31 |
Correct |
2 ms |
9048 KB |
Output is correct |
32 |
Correct |
2 ms |
9052 KB |
Output is correct |
33 |
Correct |
3 ms |
9304 KB |
Output is correct |
34 |
Correct |
1 ms |
8644 KB |
Output is correct |
35 |
Correct |
1 ms |
8536 KB |
Output is correct |
36 |
Correct |
1 ms |
8540 KB |
Output is correct |
37 |
Correct |
1 ms |
8540 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
2 ms |
8640 KB |
Output is correct |
40 |
Correct |
1 ms |
8588 KB |
Output is correct |
41 |
Correct |
1 ms |
8536 KB |
Output is correct |
42 |
Correct |
2 ms |
8656 KB |
Output is correct |
43 |
Correct |
1 ms |
8540 KB |
Output is correct |
44 |
Correct |
1 ms |
8640 KB |
Output is correct |
45 |
Correct |
1 ms |
8636 KB |
Output is correct |
46 |
Correct |
1 ms |
8540 KB |
Output is correct |
47 |
Correct |
1 ms |
8640 KB |
Output is correct |
48 |
Correct |
2 ms |
8536 KB |
Output is correct |
49 |
Correct |
1 ms |
8536 KB |
Output is correct |
50 |
Correct |
2 ms |
8540 KB |
Output is correct |
51 |
Correct |
1 ms |
8540 KB |
Output is correct |
52 |
Correct |
1 ms |
8540 KB |
Output is correct |
53 |
Correct |
1 ms |
8540 KB |
Output is correct |
54 |
Correct |
2 ms |
8540 KB |
Output is correct |
55 |
Correct |
1 ms |
8540 KB |
Output is correct |
56 |
Correct |
1 ms |
8540 KB |
Output is correct |
57 |
Correct |
2 ms |
8640 KB |
Output is correct |
58 |
Correct |
1 ms |
8540 KB |
Output is correct |
59 |
Correct |
2 ms |
8540 KB |
Output is correct |
60 |
Correct |
2 ms |
8540 KB |
Output is correct |
61 |
Correct |
1 ms |
8544 KB |
Output is correct |
62 |
Correct |
3 ms |
8540 KB |
Output is correct |
63 |
Correct |
1 ms |
8540 KB |
Output is correct |
64 |
Correct |
2 ms |
8540 KB |
Output is correct |
65 |
Correct |
1 ms |
8644 KB |
Output is correct |
66 |
Correct |
1 ms |
8540 KB |
Output is correct |
67 |
Correct |
1 ms |
8644 KB |
Output is correct |
68 |
Correct |
1 ms |
8540 KB |
Output is correct |
69 |
Correct |
2 ms |
8540 KB |
Output is correct |
70 |
Correct |
1 ms |
8540 KB |
Output is correct |
71 |
Correct |
2 ms |
8656 KB |
Output is correct |
72 |
Correct |
2 ms |
8540 KB |
Output is correct |
73 |
Correct |
1 ms |
8540 KB |
Output is correct |
74 |
Correct |
1 ms |
8540 KB |
Output is correct |
75 |
Correct |
1 ms |
8540 KB |
Output is correct |
76 |
Correct |
1 ms |
8540 KB |
Output is correct |
77 |
Correct |
1 ms |
8544 KB |
Output is correct |
78 |
Correct |
2 ms |
8540 KB |
Output is correct |
79 |
Correct |
1 ms |
8540 KB |
Output is correct |
80 |
Correct |
2 ms |
8540 KB |
Output is correct |
81 |
Correct |
1 ms |
8540 KB |
Output is correct |
82 |
Correct |
2 ms |
8540 KB |
Output is correct |
83 |
Correct |
1 ms |
8540 KB |
Output is correct |
84 |
Correct |
3 ms |
8796 KB |
Output is correct |
85 |
Correct |
3 ms |
8792 KB |
Output is correct |
86 |
Correct |
3 ms |
8796 KB |
Output is correct |
87 |
Correct |
3 ms |
8800 KB |
Output is correct |
88 |
Correct |
3 ms |
8800 KB |
Output is correct |
89 |
Correct |
3 ms |
9168 KB |
Output is correct |
90 |
Correct |
3 ms |
9164 KB |
Output is correct |
91 |
Correct |
3 ms |
9312 KB |
Output is correct |
92 |
Correct |
2 ms |
9052 KB |
Output is correct |
93 |
Correct |
2 ms |
9052 KB |
Output is correct |
94 |
Correct |
2 ms |
9052 KB |
Output is correct |
95 |
Correct |
3 ms |
9216 KB |
Output is correct |
96 |
Correct |
2 ms |
9052 KB |
Output is correct |
97 |
Correct |
3 ms |
9052 KB |
Output is correct |
98 |
Correct |
3 ms |
9168 KB |
Output is correct |
99 |
Correct |
3 ms |
9052 KB |
Output is correct |
100 |
Correct |
3 ms |
9052 KB |
Output is correct |
101 |
Correct |
3 ms |
8796 KB |
Output is correct |
102 |
Correct |
119 ms |
15672 KB |
Output is correct |
103 |
Correct |
123 ms |
16572 KB |
Output is correct |
104 |
Correct |
167 ms |
52424 KB |
Output is correct |
105 |
Correct |
132 ms |
13684 KB |
Output is correct |
106 |
Correct |
114 ms |
13096 KB |
Output is correct |
107 |
Correct |
114 ms |
51372 KB |
Output is correct |
108 |
Correct |
110 ms |
47548 KB |
Output is correct |
109 |
Correct |
77 ms |
38184 KB |
Output is correct |
110 |
Correct |
199 ms |
49080 KB |
Output is correct |
111 |
Correct |
128 ms |
48176 KB |
Output is correct |
112 |
Correct |
123 ms |
48688 KB |
Output is correct |
113 |
Correct |
133 ms |
39880 KB |
Output is correct |
114 |
Correct |
114 ms |
49440 KB |
Output is correct |
115 |
Correct |
104 ms |
43712 KB |
Output is correct |
116 |
Correct |
141 ms |
47420 KB |
Output is correct |
117 |
Correct |
168 ms |
39108 KB |
Output is correct |
118 |
Correct |
149 ms |
48228 KB |
Output is correct |
119 |
Correct |
142 ms |
17192 KB |
Output is correct |
120 |
Correct |
95 ms |
13052 KB |
Output is correct |