#include "dreaming.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define endl '\n'
#define INF 1e9+7
#define all(x) x.begin(),x.end()
using namespace std;
using namespace __gnu_pbds;
using ll=long long;
using pii=pair<int,int>;
using ppi=pair<int,pii>;
using oset=tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>;
template<typename T>
void _print(vector<T> x) {cerr<<"{"; for(auto e:x) cerr<<e<<","; cerr<<"}";}
void _print(pii x) {cerr<<"{"<<x.first<<","<<x.second<<"}";}
template<typename T>
void _print(T x) {cerr<<x;}
void dbg() {cerr<<endl;}
template<typename Head,typename... Tail>
void dbg(Head H,Tail... T) {
_print(H);
if(sizeof...(T)) cerr<<",";
else cerr<<"\"]";
dbg(T...);
}
#define debug(...) cerr<<"["<<#__VA_ARGS__<<"]:[\"",dbg(__VA_ARGS__)
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int mxn=1e5+10;
int n,m,l;
vector<pii> adj[mxn];
set<int> par_list;
vector<int> group[mxn];
int p[mxn];
vector<pii> essen;
int ans;
int findp(int x) {
while(p[x]!=x) p[x]=p[p[x]],x=p[x];
return x;
}
void unionset(int u,int v) {
int U=findp(u),V=findp(v);
p[U]=V;
}
void solve(int root,int ii) {
vector<int> dist(n,-1);
queue<pii> q;
q.push({root,0});
int mx=0,idx=0;
while(!q.empty()) {
int u=q.front().first;
int d=q.front().second;
q.pop();
dist[u]=d;
if(dist[u]>mx) {
mx=dist[u]; idx=u;
}
for(auto vw:adj[u]) {
int v=vw.first,w=vw.second;
if(dist[v]==-1) {
dist[v]=d+w;
q.push({v,d+w});
}
}
}
int mx2=0,idx2=0;
queue<pii> q2;
fill(all(dist),-1);
q2.push({idx,0});
while(!q2.empty()) {
int u=q2.front().first;
int d=q2.front().second;
q2.pop();
dist[u]=d;
if(dist[u]>mx2) {
mx2=dist[u],idx2=u;
}
for(auto vw:adj[u]) {
int v=vw.first,w=vw.second;
if(dist[v]==-1) {
dist[v]=w+d;
q2.push({v,w+d});
}
}
}
vector<int> dist2(n,-1);
queue<pii> q3;
q3.push({idx2,0});
while(!q3.empty()) {
int u=q3.front().first;
int d=q3.front().second;
q3.pop();
dist2[u]=d;
for(auto vw:adj[u]) {
int v=vw.first,w=vw.second;
if(dist2[v]==-1) {
dist2[v]=w+d;
q3.push({v,w+d});
}
}
}
int mn=INF;
int idxres;
for(auto e:group[root]) {
mn=min(mn,max(dist[e],dist2[e]));
if(max(dist[e],dist2[e])==mn) idxres=e;
}
// ans=max(ans,mx2);
essen.push_back({mn,idxres});
}
int diameter() {
vector<int> dist(n,-1);
stack<int> s;
dist[0]=0; s.push(0);
while(!s.empty()) {
int u=s.top(); s.pop();
for(auto vw:adj[u]) {
int v=vw.first,w=vw.second;
if(dist[v]==-1) {
dist[v]=dist[u]+w;
s.push(v);
}
}
}
int mx=0,idx;
for(int i=0;i<n;i++) {
assert(dist[i]!=-1);
if(dist[i]>mx) {
mx=dist[i],idx=i;
}
}
while(!s.empty()) s.pop();
vector<int> dist2(n,-1);
dist2[idx]=0;
s.push(idx);
while(!s.empty()) {
int u=s.top(); s.pop();
for(auto vw:adj[u]) {
int v=vw.first,w=vw.second;
if(dist2[v]==-1) {
dist2[v]=dist2[u]+w;
s.push(v);
}
}
}
return *max_element(all(dist2));
}
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
n=N,m=M,l=L;
if(n==1) return 0;
if(n==2) return l;
for(int i=0;i<n;i++) p[i]=i;
for(int i=0;i<m;i++) {
int u=A[i],v=B[i],w=T[i];
adj[u].push_back({v,w});
adj[v].push_back({u,w});
unionset(u,v);
}
for(int i=0;i<n;i++) {
p[i]=findp(p[i]);
// group_idx[i]=p[i];
group[p[i]].push_back(i);
par_list.insert(p[i]);
}
int sz=par_list.size();
int cnt=0;
for(auto e:par_list) {
solve(e,cnt++);
}
sort(all(essen));
int len=essen.size();
for(int i=0;i<len-1;i++) {
int u=essen[i].second;
int v=essen[len-1].second;
adj[u].push_back({v,l});
adj[v].push_back({u,l});
}
return diameter();
}
Compilation message
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:173:9: warning: unused variable 'sz' [-Wunused-variable]
173 | int sz=par_list.size();
| ^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
10612 KB |
Output is correct |
2 |
Correct |
70 ms |
10600 KB |
Output is correct |
3 |
Correct |
51 ms |
8736 KB |
Output is correct |
4 |
Correct |
14 ms |
5772 KB |
Output is correct |
5 |
Correct |
10 ms |
5588 KB |
Output is correct |
6 |
Correct |
21 ms |
6220 KB |
Output is correct |
7 |
Correct |
5 ms |
5032 KB |
Output is correct |
8 |
Correct |
33 ms |
7508 KB |
Output is correct |
9 |
Correct |
44 ms |
8048 KB |
Output is correct |
10 |
Correct |
3 ms |
4940 KB |
Output is correct |
11 |
Correct |
82 ms |
9520 KB |
Output is correct |
12 |
Correct |
84 ms |
9844 KB |
Output is correct |
13 |
Correct |
3 ms |
4940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4972 KB |
Output is correct |
3 |
Correct |
3 ms |
4940 KB |
Output is correct |
4 |
Correct |
3 ms |
4940 KB |
Output is correct |
5 |
Correct |
3 ms |
4940 KB |
Output is correct |
6 |
Correct |
3 ms |
4940 KB |
Output is correct |
7 |
Correct |
4 ms |
4940 KB |
Output is correct |
8 |
Correct |
3 ms |
4940 KB |
Output is correct |
9 |
Correct |
3 ms |
4940 KB |
Output is correct |
10 |
Correct |
3 ms |
4940 KB |
Output is correct |
11 |
Correct |
3 ms |
4940 KB |
Output is correct |
12 |
Correct |
3 ms |
4940 KB |
Output is correct |
13 |
Correct |
3 ms |
4940 KB |
Output is correct |
14 |
Correct |
3 ms |
4952 KB |
Output is correct |
15 |
Correct |
3 ms |
4940 KB |
Output is correct |
16 |
Correct |
3 ms |
4940 KB |
Output is correct |
17 |
Correct |
3 ms |
4940 KB |
Output is correct |
18 |
Correct |
3 ms |
4944 KB |
Output is correct |
19 |
Correct |
3 ms |
4940 KB |
Output is correct |
20 |
Correct |
3 ms |
4944 KB |
Output is correct |
21 |
Correct |
3 ms |
4940 KB |
Output is correct |
22 |
Correct |
3 ms |
4940 KB |
Output is correct |
23 |
Correct |
3 ms |
4940 KB |
Output is correct |
24 |
Correct |
3 ms |
4940 KB |
Output is correct |
25 |
Correct |
3 ms |
4940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
10612 KB |
Output is correct |
2 |
Correct |
70 ms |
10600 KB |
Output is correct |
3 |
Correct |
51 ms |
8736 KB |
Output is correct |
4 |
Correct |
14 ms |
5772 KB |
Output is correct |
5 |
Correct |
10 ms |
5588 KB |
Output is correct |
6 |
Correct |
21 ms |
6220 KB |
Output is correct |
7 |
Correct |
5 ms |
5032 KB |
Output is correct |
8 |
Correct |
33 ms |
7508 KB |
Output is correct |
9 |
Correct |
44 ms |
8048 KB |
Output is correct |
10 |
Correct |
3 ms |
4940 KB |
Output is correct |
11 |
Correct |
82 ms |
9520 KB |
Output is correct |
12 |
Correct |
84 ms |
9844 KB |
Output is correct |
13 |
Correct |
3 ms |
4940 KB |
Output is correct |
14 |
Correct |
4 ms |
4940 KB |
Output is correct |
15 |
Correct |
3 ms |
4972 KB |
Output is correct |
16 |
Correct |
3 ms |
4940 KB |
Output is correct |
17 |
Correct |
3 ms |
4940 KB |
Output is correct |
18 |
Correct |
3 ms |
4940 KB |
Output is correct |
19 |
Correct |
3 ms |
4940 KB |
Output is correct |
20 |
Correct |
4 ms |
4940 KB |
Output is correct |
21 |
Correct |
3 ms |
4940 KB |
Output is correct |
22 |
Correct |
3 ms |
4940 KB |
Output is correct |
23 |
Correct |
3 ms |
4940 KB |
Output is correct |
24 |
Correct |
3 ms |
4940 KB |
Output is correct |
25 |
Correct |
3 ms |
4940 KB |
Output is correct |
26 |
Correct |
3 ms |
4940 KB |
Output is correct |
27 |
Correct |
3 ms |
4952 KB |
Output is correct |
28 |
Correct |
3 ms |
4940 KB |
Output is correct |
29 |
Correct |
3 ms |
4940 KB |
Output is correct |
30 |
Correct |
3 ms |
4940 KB |
Output is correct |
31 |
Correct |
3 ms |
4944 KB |
Output is correct |
32 |
Correct |
3 ms |
4940 KB |
Output is correct |
33 |
Correct |
3 ms |
4944 KB |
Output is correct |
34 |
Correct |
3 ms |
4940 KB |
Output is correct |
35 |
Correct |
3 ms |
4940 KB |
Output is correct |
36 |
Correct |
3 ms |
4940 KB |
Output is correct |
37 |
Correct |
3 ms |
4940 KB |
Output is correct |
38 |
Correct |
3 ms |
4940 KB |
Output is correct |
39 |
Correct |
65 ms |
10612 KB |
Output is correct |
40 |
Correct |
66 ms |
10676 KB |
Output is correct |
41 |
Correct |
53 ms |
8664 KB |
Output is correct |
42 |
Correct |
11 ms |
5708 KB |
Output is correct |
43 |
Correct |
3 ms |
4940 KB |
Output is correct |
44 |
Correct |
4 ms |
4940 KB |
Output is correct |
45 |
Correct |
3 ms |
4940 KB |
Output is correct |
46 |
Correct |
4 ms |
4928 KB |
Output is correct |
47 |
Correct |
3 ms |
4940 KB |
Output is correct |
48 |
Correct |
3 ms |
4940 KB |
Output is correct |
49 |
Correct |
3 ms |
4940 KB |
Output is correct |
50 |
Correct |
3 ms |
5000 KB |
Output is correct |
51 |
Correct |
4 ms |
4940 KB |
Output is correct |
52 |
Correct |
3 ms |
4940 KB |
Output is correct |
53 |
Correct |
3 ms |
4940 KB |
Output is correct |
54 |
Correct |
3 ms |
4940 KB |
Output is correct |
55 |
Correct |
3 ms |
4940 KB |
Output is correct |
56 |
Correct |
4 ms |
5016 KB |
Output is correct |
57 |
Correct |
98 ms |
11752 KB |
Output is correct |
58 |
Correct |
105 ms |
11764 KB |
Output is correct |
59 |
Correct |
100 ms |
11636 KB |
Output is correct |
60 |
Correct |
109 ms |
11688 KB |
Output is correct |
61 |
Correct |
99 ms |
11604 KB |
Output is correct |
62 |
Correct |
102 ms |
11652 KB |
Output is correct |
63 |
Correct |
102 ms |
11528 KB |
Output is correct |
64 |
Correct |
106 ms |
11468 KB |
Output is correct |
65 |
Correct |
116 ms |
13204 KB |
Output is correct |
66 |
Correct |
103 ms |
13096 KB |
Output is correct |
67 |
Correct |
96 ms |
13004 KB |
Output is correct |
68 |
Correct |
95 ms |
12928 KB |
Output is correct |
69 |
Correct |
99 ms |
13352 KB |
Output is correct |
70 |
Correct |
99 ms |
13376 KB |
Output is correct |
71 |
Correct |
3 ms |
4940 KB |
Output is correct |
72 |
Correct |
5 ms |
5152 KB |
Output is correct |
73 |
Correct |
5 ms |
5196 KB |
Output is correct |
74 |
Correct |
5 ms |
5148 KB |
Output is correct |
75 |
Correct |
5 ms |
5196 KB |
Output is correct |
76 |
Correct |
5 ms |
5196 KB |
Output is correct |
77 |
Correct |
5 ms |
5196 KB |
Output is correct |
78 |
Correct |
5 ms |
5192 KB |
Output is correct |
79 |
Correct |
5 ms |
5196 KB |
Output is correct |
80 |
Correct |
108 ms |
13116 KB |
Output is correct |
81 |
Correct |
92 ms |
13032 KB |
Output is correct |
82 |
Correct |
91 ms |
13240 KB |
Output is correct |
83 |
Correct |
87 ms |
13160 KB |
Output is correct |
84 |
Correct |
5 ms |
5196 KB |
Output is correct |
85 |
Correct |
5 ms |
5180 KB |
Output is correct |
86 |
Correct |
5 ms |
5196 KB |
Output is correct |
87 |
Correct |
5 ms |
5196 KB |
Output is correct |
88 |
Correct |
5 ms |
5188 KB |
Output is correct |
89 |
Correct |
5 ms |
5196 KB |
Output is correct |
90 |
Correct |
5 ms |
5148 KB |
Output is correct |
91 |
Correct |
5 ms |
5196 KB |
Output is correct |
92 |
Correct |
5 ms |
5196 KB |
Output is correct |
93 |
Correct |
5 ms |
5196 KB |
Output is correct |
94 |
Correct |
4 ms |
5004 KB |
Output is correct |
95 |
Correct |
4 ms |
4940 KB |
Output is correct |
96 |
Correct |
3 ms |
4928 KB |
Output is correct |
97 |
Correct |
3 ms |
4940 KB |
Output is correct |
98 |
Correct |
3 ms |
4940 KB |
Output is correct |
99 |
Correct |
3 ms |
4940 KB |
Output is correct |
100 |
Correct |
3 ms |
5004 KB |
Output is correct |
101 |
Correct |
4 ms |
4940 KB |
Output is correct |
102 |
Correct |
3 ms |
4940 KB |
Output is correct |
103 |
Correct |
3 ms |
4940 KB |
Output is correct |
104 |
Correct |
10 ms |
5708 KB |
Output is correct |
105 |
Correct |
19 ms |
6524 KB |
Output is correct |
106 |
Correct |
3 ms |
5008 KB |
Output is correct |
107 |
Correct |
34 ms |
8012 KB |
Output is correct |
108 |
Correct |
45 ms |
8708 KB |
Output is correct |
109 |
Correct |
4 ms |
4940 KB |
Output is correct |
110 |
Correct |
65 ms |
10396 KB |
Output is correct |
111 |
Correct |
69 ms |
10892 KB |
Output is correct |
112 |
Correct |
4 ms |
5012 KB |
Output is correct |
113 |
Correct |
120 ms |
12952 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1081 ms |
13476 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
4940 KB |
Output is correct |
2 |
Correct |
3 ms |
4972 KB |
Output is correct |
3 |
Correct |
3 ms |
4940 KB |
Output is correct |
4 |
Correct |
3 ms |
4940 KB |
Output is correct |
5 |
Correct |
3 ms |
4940 KB |
Output is correct |
6 |
Correct |
3 ms |
4940 KB |
Output is correct |
7 |
Correct |
4 ms |
4940 KB |
Output is correct |
8 |
Correct |
3 ms |
4940 KB |
Output is correct |
9 |
Correct |
3 ms |
4940 KB |
Output is correct |
10 |
Correct |
3 ms |
4940 KB |
Output is correct |
11 |
Correct |
3 ms |
4940 KB |
Output is correct |
12 |
Correct |
3 ms |
4940 KB |
Output is correct |
13 |
Correct |
3 ms |
4940 KB |
Output is correct |
14 |
Correct |
3 ms |
4952 KB |
Output is correct |
15 |
Correct |
3 ms |
4940 KB |
Output is correct |
16 |
Correct |
3 ms |
4940 KB |
Output is correct |
17 |
Correct |
3 ms |
4940 KB |
Output is correct |
18 |
Correct |
3 ms |
4944 KB |
Output is correct |
19 |
Correct |
3 ms |
4940 KB |
Output is correct |
20 |
Correct |
3 ms |
4944 KB |
Output is correct |
21 |
Correct |
3 ms |
4940 KB |
Output is correct |
22 |
Correct |
3 ms |
4940 KB |
Output is correct |
23 |
Correct |
3 ms |
4940 KB |
Output is correct |
24 |
Correct |
3 ms |
4940 KB |
Output is correct |
25 |
Correct |
3 ms |
4940 KB |
Output is correct |
26 |
Correct |
4 ms |
5068 KB |
Output is correct |
27 |
Correct |
5 ms |
5164 KB |
Output is correct |
28 |
Correct |
8 ms |
5248 KB |
Output is correct |
29 |
Correct |
5 ms |
5068 KB |
Output is correct |
30 |
Correct |
6 ms |
5068 KB |
Output is correct |
31 |
Correct |
8 ms |
5200 KB |
Output is correct |
32 |
Correct |
4 ms |
5068 KB |
Output is correct |
33 |
Correct |
6 ms |
5188 KB |
Output is correct |
34 |
Correct |
10 ms |
5276 KB |
Output is correct |
35 |
Correct |
4 ms |
4940 KB |
Output is correct |
36 |
Correct |
3 ms |
4940 KB |
Output is correct |
37 |
Correct |
4 ms |
5004 KB |
Output is correct |
38 |
Correct |
4 ms |
4940 KB |
Output is correct |
39 |
Correct |
3 ms |
4940 KB |
Output is correct |
40 |
Correct |
3 ms |
4940 KB |
Output is correct |
41 |
Correct |
3 ms |
4940 KB |
Output is correct |
42 |
Correct |
3 ms |
4940 KB |
Output is correct |
43 |
Correct |
3 ms |
4940 KB |
Output is correct |
44 |
Correct |
3 ms |
4940 KB |
Output is correct |
45 |
Correct |
3 ms |
5000 KB |
Output is correct |
46 |
Correct |
4 ms |
4940 KB |
Output is correct |
47 |
Correct |
4 ms |
4940 KB |
Output is correct |
48 |
Correct |
4 ms |
4940 KB |
Output is correct |
49 |
Correct |
3 ms |
4940 KB |
Output is correct |
50 |
Correct |
3 ms |
4940 KB |
Output is correct |
51 |
Correct |
3 ms |
5004 KB |
Output is correct |
52 |
Correct |
3 ms |
4940 KB |
Output is correct |
53 |
Correct |
3 ms |
4940 KB |
Output is correct |
54 |
Correct |
5 ms |
5144 KB |
Output is correct |
55 |
Correct |
6 ms |
5276 KB |
Output is correct |
56 |
Correct |
11 ms |
5292 KB |
Output is correct |
57 |
Correct |
17 ms |
5316 KB |
Output is correct |
58 |
Correct |
5 ms |
5140 KB |
Output is correct |
59 |
Correct |
5 ms |
5196 KB |
Output is correct |
60 |
Correct |
13 ms |
5328 KB |
Output is correct |
61 |
Correct |
15 ms |
5316 KB |
Output is correct |
62 |
Correct |
5 ms |
5144 KB |
Output is correct |
63 |
Correct |
5 ms |
5196 KB |
Output is correct |
64 |
Correct |
18 ms |
5308 KB |
Output is correct |
65 |
Correct |
11 ms |
5292 KB |
Output is correct |
66 |
Correct |
5 ms |
5196 KB |
Output is correct |
67 |
Correct |
5 ms |
5192 KB |
Output is correct |
68 |
Correct |
11 ms |
5324 KB |
Output is correct |
69 |
Correct |
11 ms |
5284 KB |
Output is correct |
70 |
Correct |
18 ms |
5304 KB |
Output is correct |
71 |
Correct |
16 ms |
5324 KB |
Output is correct |
72 |
Correct |
5 ms |
5272 KB |
Output is correct |
73 |
Correct |
5 ms |
5188 KB |
Output is correct |
74 |
Correct |
6 ms |
5196 KB |
Output is correct |
75 |
Correct |
6 ms |
5196 KB |
Output is correct |
76 |
Correct |
5 ms |
5144 KB |
Output is correct |
77 |
Correct |
5 ms |
5196 KB |
Output is correct |
78 |
Correct |
15 ms |
5316 KB |
Output is correct |
79 |
Correct |
19 ms |
5316 KB |
Output is correct |
80 |
Correct |
23 ms |
5376 KB |
Output is correct |
81 |
Correct |
21 ms |
5424 KB |
Output is correct |
82 |
Correct |
9 ms |
5284 KB |
Output is correct |
83 |
Correct |
7 ms |
5196 KB |
Output is correct |
84 |
Correct |
14 ms |
5324 KB |
Output is correct |
85 |
Correct |
18 ms |
5292 KB |
Output is correct |
86 |
Correct |
10 ms |
5324 KB |
Output is correct |
87 |
Correct |
27 ms |
5256 KB |
Output is correct |
88 |
Correct |
11 ms |
5280 KB |
Output is correct |
89 |
Correct |
12 ms |
5324 KB |
Output is correct |
90 |
Correct |
13 ms |
5324 KB |
Output is correct |
91 |
Correct |
15 ms |
5296 KB |
Output is correct |
92 |
Correct |
4 ms |
5148 KB |
Output is correct |
93 |
Correct |
4 ms |
5060 KB |
Output is correct |
94 |
Correct |
4 ms |
5196 KB |
Output is correct |
95 |
Correct |
5 ms |
5144 KB |
Output is correct |
96 |
Correct |
5 ms |
5152 KB |
Output is correct |
97 |
Correct |
5 ms |
5196 KB |
Output is correct |
98 |
Correct |
5 ms |
5188 KB |
Output is correct |
99 |
Correct |
6 ms |
5196 KB |
Output is correct |
100 |
Correct |
5 ms |
5140 KB |
Output is correct |
101 |
Correct |
4 ms |
5196 KB |
Output is correct |
102 |
Correct |
3 ms |
4940 KB |
Output is correct |
103 |
Correct |
3 ms |
4940 KB |
Output is correct |
104 |
Correct |
3 ms |
4940 KB |
Output is correct |
105 |
Correct |
3 ms |
4940 KB |
Output is correct |
106 |
Correct |
3 ms |
5024 KB |
Output is correct |
107 |
Correct |
3 ms |
4940 KB |
Output is correct |
108 |
Correct |
3 ms |
4940 KB |
Output is correct |
109 |
Correct |
3 ms |
4924 KB |
Output is correct |
110 |
Correct |
3 ms |
4940 KB |
Output is correct |
111 |
Correct |
3 ms |
4940 KB |
Output is correct |
112 |
Correct |
3 ms |
4940 KB |
Output is correct |
113 |
Correct |
5 ms |
4940 KB |
Output is correct |
114 |
Correct |
4 ms |
5016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
10612 KB |
Output is correct |
2 |
Correct |
70 ms |
10600 KB |
Output is correct |
3 |
Correct |
51 ms |
8736 KB |
Output is correct |
4 |
Correct |
14 ms |
5772 KB |
Output is correct |
5 |
Correct |
10 ms |
5588 KB |
Output is correct |
6 |
Correct |
21 ms |
6220 KB |
Output is correct |
7 |
Correct |
5 ms |
5032 KB |
Output is correct |
8 |
Correct |
33 ms |
7508 KB |
Output is correct |
9 |
Correct |
44 ms |
8048 KB |
Output is correct |
10 |
Correct |
3 ms |
4940 KB |
Output is correct |
11 |
Correct |
82 ms |
9520 KB |
Output is correct |
12 |
Correct |
84 ms |
9844 KB |
Output is correct |
13 |
Correct |
3 ms |
4940 KB |
Output is correct |
14 |
Correct |
4 ms |
4940 KB |
Output is correct |
15 |
Correct |
3 ms |
4972 KB |
Output is correct |
16 |
Correct |
3 ms |
4940 KB |
Output is correct |
17 |
Correct |
3 ms |
4940 KB |
Output is correct |
18 |
Correct |
3 ms |
4940 KB |
Output is correct |
19 |
Correct |
3 ms |
4940 KB |
Output is correct |
20 |
Correct |
4 ms |
4940 KB |
Output is correct |
21 |
Correct |
3 ms |
4940 KB |
Output is correct |
22 |
Correct |
3 ms |
4940 KB |
Output is correct |
23 |
Correct |
3 ms |
4940 KB |
Output is correct |
24 |
Correct |
3 ms |
4940 KB |
Output is correct |
25 |
Correct |
3 ms |
4940 KB |
Output is correct |
26 |
Correct |
3 ms |
4940 KB |
Output is correct |
27 |
Correct |
3 ms |
4952 KB |
Output is correct |
28 |
Correct |
3 ms |
4940 KB |
Output is correct |
29 |
Correct |
3 ms |
4940 KB |
Output is correct |
30 |
Correct |
3 ms |
4940 KB |
Output is correct |
31 |
Correct |
3 ms |
4944 KB |
Output is correct |
32 |
Correct |
3 ms |
4940 KB |
Output is correct |
33 |
Correct |
3 ms |
4944 KB |
Output is correct |
34 |
Correct |
3 ms |
4940 KB |
Output is correct |
35 |
Correct |
3 ms |
4940 KB |
Output is correct |
36 |
Correct |
3 ms |
4940 KB |
Output is correct |
37 |
Correct |
3 ms |
4940 KB |
Output is correct |
38 |
Correct |
3 ms |
4940 KB |
Output is correct |
39 |
Correct |
65 ms |
10612 KB |
Output is correct |
40 |
Correct |
66 ms |
10676 KB |
Output is correct |
41 |
Correct |
53 ms |
8664 KB |
Output is correct |
42 |
Correct |
11 ms |
5708 KB |
Output is correct |
43 |
Correct |
3 ms |
4940 KB |
Output is correct |
44 |
Correct |
4 ms |
4940 KB |
Output is correct |
45 |
Correct |
3 ms |
4940 KB |
Output is correct |
46 |
Correct |
4 ms |
4928 KB |
Output is correct |
47 |
Correct |
3 ms |
4940 KB |
Output is correct |
48 |
Correct |
3 ms |
4940 KB |
Output is correct |
49 |
Correct |
3 ms |
4940 KB |
Output is correct |
50 |
Correct |
3 ms |
5000 KB |
Output is correct |
51 |
Correct |
4 ms |
4940 KB |
Output is correct |
52 |
Correct |
3 ms |
4940 KB |
Output is correct |
53 |
Correct |
3 ms |
4940 KB |
Output is correct |
54 |
Correct |
3 ms |
4940 KB |
Output is correct |
55 |
Correct |
3 ms |
4940 KB |
Output is correct |
56 |
Correct |
4 ms |
5016 KB |
Output is correct |
57 |
Correct |
98 ms |
11752 KB |
Output is correct |
58 |
Correct |
105 ms |
11764 KB |
Output is correct |
59 |
Correct |
100 ms |
11636 KB |
Output is correct |
60 |
Correct |
109 ms |
11688 KB |
Output is correct |
61 |
Correct |
99 ms |
11604 KB |
Output is correct |
62 |
Correct |
102 ms |
11652 KB |
Output is correct |
63 |
Correct |
102 ms |
11528 KB |
Output is correct |
64 |
Correct |
106 ms |
11468 KB |
Output is correct |
65 |
Correct |
116 ms |
13204 KB |
Output is correct |
66 |
Correct |
103 ms |
13096 KB |
Output is correct |
67 |
Correct |
96 ms |
13004 KB |
Output is correct |
68 |
Correct |
95 ms |
12928 KB |
Output is correct |
69 |
Correct |
99 ms |
13352 KB |
Output is correct |
70 |
Correct |
99 ms |
13376 KB |
Output is correct |
71 |
Correct |
3 ms |
4940 KB |
Output is correct |
72 |
Correct |
5 ms |
5152 KB |
Output is correct |
73 |
Correct |
5 ms |
5196 KB |
Output is correct |
74 |
Correct |
5 ms |
5148 KB |
Output is correct |
75 |
Correct |
5 ms |
5196 KB |
Output is correct |
76 |
Correct |
5 ms |
5196 KB |
Output is correct |
77 |
Correct |
5 ms |
5196 KB |
Output is correct |
78 |
Correct |
5 ms |
5192 KB |
Output is correct |
79 |
Correct |
5 ms |
5196 KB |
Output is correct |
80 |
Correct |
108 ms |
13116 KB |
Output is correct |
81 |
Correct |
92 ms |
13032 KB |
Output is correct |
82 |
Correct |
91 ms |
13240 KB |
Output is correct |
83 |
Correct |
87 ms |
13160 KB |
Output is correct |
84 |
Correct |
5 ms |
5196 KB |
Output is correct |
85 |
Correct |
5 ms |
5180 KB |
Output is correct |
86 |
Correct |
5 ms |
5196 KB |
Output is correct |
87 |
Correct |
5 ms |
5196 KB |
Output is correct |
88 |
Correct |
5 ms |
5188 KB |
Output is correct |
89 |
Correct |
5 ms |
5196 KB |
Output is correct |
90 |
Correct |
5 ms |
5148 KB |
Output is correct |
91 |
Correct |
5 ms |
5196 KB |
Output is correct |
92 |
Correct |
5 ms |
5196 KB |
Output is correct |
93 |
Correct |
5 ms |
5196 KB |
Output is correct |
94 |
Correct |
4 ms |
5004 KB |
Output is correct |
95 |
Correct |
4 ms |
4940 KB |
Output is correct |
96 |
Correct |
3 ms |
4928 KB |
Output is correct |
97 |
Correct |
3 ms |
4940 KB |
Output is correct |
98 |
Correct |
3 ms |
4940 KB |
Output is correct |
99 |
Correct |
3 ms |
4940 KB |
Output is correct |
100 |
Correct |
3 ms |
5004 KB |
Output is correct |
101 |
Correct |
4 ms |
4940 KB |
Output is correct |
102 |
Correct |
3 ms |
4940 KB |
Output is correct |
103 |
Correct |
3 ms |
4940 KB |
Output is correct |
104 |
Correct |
10 ms |
5708 KB |
Output is correct |
105 |
Correct |
19 ms |
6524 KB |
Output is correct |
106 |
Correct |
3 ms |
5008 KB |
Output is correct |
107 |
Correct |
34 ms |
8012 KB |
Output is correct |
108 |
Correct |
45 ms |
8708 KB |
Output is correct |
109 |
Correct |
4 ms |
4940 KB |
Output is correct |
110 |
Correct |
65 ms |
10396 KB |
Output is correct |
111 |
Correct |
69 ms |
10892 KB |
Output is correct |
112 |
Correct |
4 ms |
5012 KB |
Output is correct |
113 |
Correct |
120 ms |
12952 KB |
Output is correct |
114 |
Execution timed out |
1081 ms |
13476 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |