#include <stdio.h>
#include <string.h>
#include <queue>
#include <vector>
#include <algorithm>
#include "dreaming.h"
using namespace std;
class e {
public:
int v, w;
e(int v, int w)
:v(v),w(w)
{}
};
vector<e> con[100001];
int n, m, l, d[100001];
bool vis[100001];
vector<int> comp[100001];
int k;
int solve(int pre, int u, int up) {
int mx1=up, mx2=-1, v1=-1, v2=-1;
for(int i=0;i<con[u].size();i++) {
int v=con[u][i].v, w=con[u][i].w;
if(pre==v) continue;
if(d[v]+w>=mx1) {
mx2=mx1;
v2=v1;
mx1=d[v]+w;
v1=v;
} else if(d[v]+w>mx2) {
mx2=d[v]+w;
v2=v;
}
}
int ret=mx1;
for(int i=0;i<con[u].size();i++) {
int v=con[u][i].v, w=con[u][i].w;
if(pre==v) continue;
if(v==v1) ret=min(ret,solve(u,v,mx2+w));
else ret=min(ret,solve(u,v,mx1+w));
}
return ret;
}
void dfs(int pre, int u) {
comp[k].push_back(u);
vis[u]=true;
for(int i=0;i<con[u].size();i++) {
int v=con[u][i].v, w=con[u][i].w;
if(pre==v) continue;
dfs(u,v);
d[u]=max(d[u],d[v]+w);
}
}
int dia(int u, bool fst, int c) {
for(int i=0;i<comp[c].size();i++)
d[comp[c][i]]=-1;
queue<int> q;
q.push(u);
d[u]=0;
while(!q.empty()) {
int u=q.front();
q.pop();
for(int i=0;i<con[u].size();i++) {
int v=con[u][i].v, w=con[u][i].w;
if(d[v]<0) {
d[v]=d[u]+w;
q.push(v);
}
}
}
int mx=-1, tar;
for(int i=1;i<=n;i++) {
if(d[i]>mx) {
mx=d[i]; tar=i;
}
}
if(fst) return dia(tar,false,c);
else return mx;
}
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
n=N; m=M; l=L;
for(int i=0;i<m;i++) {
int u, v, w;
u=A[i]; v=B[i]; w=T[i];
u++; v++;
con[u].push_back(e(v,w));
con[v].push_back(e(u,w));
}
vector<int> rt;
for(int i=1;i<=n;i++) if(!vis[i]) {
rt.push_back(i);
dfs(-1,i);
k++;
}
vector<int> v;
for(int i=0;i<rt.size();i++)
v.push_back(solve(-1,rt[i],0));
sort(v.begin(),v.end());
for(int i=0;i<v.size()-1;i++) v[i]+=l;
sort(v.begin(),v.end());
int ret=0;
for(int i=0;i<rt.size();i++)
ret=max(ret,dia(rt[i],true,i));
if(v.size()>=2) ret=max(ret,v.back()+v[v.size()-2]);
return ret;
}
Compilation message
dreaming.cpp: In function 'int solve(int, int, int)':
dreaming.cpp:26:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<con[u].size();i++) {
~^~~~~~~~~~~~~~
dreaming.cpp:40:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<con[u].size();i++) {
~^~~~~~~~~~~~~~
dreaming.cpp:25:29: warning: variable 'v2' set but not used [-Wunused-but-set-variable]
int mx1=up, mx2=-1, v1=-1, v2=-1;
^~
dreaming.cpp: In function 'void dfs(int, int)':
dreaming.cpp:52:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<con[u].size();i++) {
~^~~~~~~~~~~~~~
dreaming.cpp: In function 'int dia(int, bool, int)':
dreaming.cpp:61:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<comp[c].size();i++)
~^~~~~~~~~~~~~~~
dreaming.cpp:69:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<con[u].size();i++) {
~^~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:103:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<rt.size();i++)
~^~~~~~~~~~
dreaming.cpp:106:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<v.size()-1;i++) v[i]+=l;
~^~~~~~~~~~~
dreaming.cpp:109:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<rt.size();i++)
~^~~~~~~~~~
dreaming.cpp: In function 'int dia(int, bool, int)':
dreaming.cpp:83:32: warning: 'tar' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(fst) return dia(tar,false,c);
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
13812 KB |
Output is correct |
2 |
Correct |
65 ms |
13556 KB |
Output is correct |
3 |
Correct |
48 ms |
12316 KB |
Output is correct |
4 |
Correct |
13 ms |
6272 KB |
Output is correct |
5 |
Correct |
12 ms |
5760 KB |
Output is correct |
6 |
Correct |
20 ms |
7040 KB |
Output is correct |
7 |
Correct |
5 ms |
4992 KB |
Output is correct |
8 |
Correct |
34 ms |
8832 KB |
Output is correct |
9 |
Correct |
43 ms |
10744 KB |
Output is correct |
10 |
Correct |
6 ms |
5120 KB |
Output is correct |
11 |
Correct |
79 ms |
11508 KB |
Output is correct |
12 |
Correct |
66 ms |
12528 KB |
Output is correct |
13 |
Correct |
6 ms |
5120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
13812 KB |
Output is correct |
2 |
Correct |
65 ms |
13556 KB |
Output is correct |
3 |
Correct |
48 ms |
12316 KB |
Output is correct |
4 |
Correct |
13 ms |
6272 KB |
Output is correct |
5 |
Correct |
12 ms |
5760 KB |
Output is correct |
6 |
Correct |
20 ms |
7040 KB |
Output is correct |
7 |
Correct |
5 ms |
4992 KB |
Output is correct |
8 |
Correct |
34 ms |
8832 KB |
Output is correct |
9 |
Correct |
43 ms |
10744 KB |
Output is correct |
10 |
Correct |
6 ms |
5120 KB |
Output is correct |
11 |
Correct |
79 ms |
11508 KB |
Output is correct |
12 |
Correct |
66 ms |
12528 KB |
Output is correct |
13 |
Correct |
6 ms |
5120 KB |
Output is correct |
14 |
Correct |
6 ms |
4992 KB |
Output is correct |
15 |
Correct |
6 ms |
4992 KB |
Output is correct |
16 |
Correct |
5 ms |
4992 KB |
Output is correct |
17 |
Correct |
6 ms |
4992 KB |
Output is correct |
18 |
Correct |
5 ms |
4992 KB |
Output is correct |
19 |
Correct |
5 ms |
4992 KB |
Output is correct |
20 |
Correct |
5 ms |
4992 KB |
Output is correct |
21 |
Correct |
5 ms |
4992 KB |
Output is correct |
22 |
Correct |
6 ms |
4992 KB |
Output is correct |
23 |
Correct |
6 ms |
4992 KB |
Output is correct |
24 |
Correct |
5 ms |
4992 KB |
Output is correct |
25 |
Correct |
5 ms |
4992 KB |
Output is correct |
26 |
Correct |
5 ms |
4992 KB |
Output is correct |
27 |
Correct |
5 ms |
5120 KB |
Output is correct |
28 |
Correct |
5 ms |
4992 KB |
Output is correct |
29 |
Correct |
6 ms |
4992 KB |
Output is correct |
30 |
Correct |
6 ms |
4992 KB |
Output is correct |
31 |
Correct |
6 ms |
4992 KB |
Output is correct |
32 |
Correct |
6 ms |
4992 KB |
Output is correct |
33 |
Correct |
6 ms |
4992 KB |
Output is correct |
34 |
Correct |
5 ms |
4992 KB |
Output is correct |
35 |
Correct |
6 ms |
4992 KB |
Output is correct |
36 |
Correct |
5 ms |
4992 KB |
Output is correct |
37 |
Correct |
5 ms |
4992 KB |
Output is correct |
38 |
Correct |
6 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
13812 KB |
Output is correct |
2 |
Correct |
65 ms |
13556 KB |
Output is correct |
3 |
Correct |
48 ms |
12316 KB |
Output is correct |
4 |
Correct |
13 ms |
6272 KB |
Output is correct |
5 |
Correct |
12 ms |
5760 KB |
Output is correct |
6 |
Correct |
20 ms |
7040 KB |
Output is correct |
7 |
Correct |
5 ms |
4992 KB |
Output is correct |
8 |
Correct |
34 ms |
8832 KB |
Output is correct |
9 |
Correct |
43 ms |
10744 KB |
Output is correct |
10 |
Correct |
6 ms |
5120 KB |
Output is correct |
11 |
Correct |
79 ms |
11508 KB |
Output is correct |
12 |
Correct |
66 ms |
12528 KB |
Output is correct |
13 |
Correct |
6 ms |
5120 KB |
Output is correct |
14 |
Correct |
6 ms |
4992 KB |
Output is correct |
15 |
Correct |
6 ms |
4992 KB |
Output is correct |
16 |
Correct |
5 ms |
4992 KB |
Output is correct |
17 |
Correct |
6 ms |
4992 KB |
Output is correct |
18 |
Correct |
5 ms |
4992 KB |
Output is correct |
19 |
Correct |
5 ms |
4992 KB |
Output is correct |
20 |
Correct |
5 ms |
4992 KB |
Output is correct |
21 |
Correct |
5 ms |
4992 KB |
Output is correct |
22 |
Correct |
6 ms |
4992 KB |
Output is correct |
23 |
Correct |
6 ms |
4992 KB |
Output is correct |
24 |
Correct |
5 ms |
4992 KB |
Output is correct |
25 |
Correct |
5 ms |
4992 KB |
Output is correct |
26 |
Correct |
5 ms |
4992 KB |
Output is correct |
27 |
Correct |
5 ms |
5120 KB |
Output is correct |
28 |
Correct |
5 ms |
4992 KB |
Output is correct |
29 |
Correct |
6 ms |
4992 KB |
Output is correct |
30 |
Correct |
6 ms |
4992 KB |
Output is correct |
31 |
Correct |
6 ms |
4992 KB |
Output is correct |
32 |
Correct |
6 ms |
4992 KB |
Output is correct |
33 |
Correct |
6 ms |
4992 KB |
Output is correct |
34 |
Correct |
5 ms |
4992 KB |
Output is correct |
35 |
Correct |
6 ms |
4992 KB |
Output is correct |
36 |
Correct |
5 ms |
4992 KB |
Output is correct |
37 |
Correct |
5 ms |
4992 KB |
Output is correct |
38 |
Correct |
6 ms |
4992 KB |
Output is correct |
39 |
Correct |
74 ms |
13848 KB |
Output is correct |
40 |
Correct |
78 ms |
13524 KB |
Output is correct |
41 |
Correct |
45 ms |
12276 KB |
Output is correct |
42 |
Correct |
13 ms |
6272 KB |
Output is correct |
43 |
Correct |
6 ms |
5120 KB |
Output is correct |
44 |
Correct |
6 ms |
5120 KB |
Output is correct |
45 |
Correct |
5 ms |
4992 KB |
Output is correct |
46 |
Correct |
5 ms |
4992 KB |
Output is correct |
47 |
Correct |
5 ms |
4992 KB |
Output is correct |
48 |
Correct |
5 ms |
4992 KB |
Output is correct |
49 |
Correct |
6 ms |
4992 KB |
Output is correct |
50 |
Correct |
6 ms |
4992 KB |
Output is correct |
51 |
Correct |
6 ms |
4992 KB |
Output is correct |
52 |
Correct |
7 ms |
4992 KB |
Output is correct |
53 |
Correct |
6 ms |
4992 KB |
Output is correct |
54 |
Correct |
5 ms |
4992 KB |
Output is correct |
55 |
Correct |
5 ms |
4992 KB |
Output is correct |
56 |
Correct |
6 ms |
5108 KB |
Output is correct |
57 |
Correct |
96 ms |
11380 KB |
Output is correct |
58 |
Correct |
91 ms |
11256 KB |
Output is correct |
59 |
Correct |
112 ms |
11252 KB |
Output is correct |
60 |
Correct |
96 ms |
11124 KB |
Output is correct |
61 |
Correct |
103 ms |
11124 KB |
Output is correct |
62 |
Correct |
84 ms |
11000 KB |
Output is correct |
63 |
Correct |
78 ms |
11000 KB |
Output is correct |
64 |
Correct |
77 ms |
11000 KB |
Output is correct |
65 |
Correct |
73 ms |
11048 KB |
Output is correct |
66 |
Correct |
92 ms |
11000 KB |
Output is correct |
67 |
Correct |
80 ms |
11252 KB |
Output is correct |
68 |
Correct |
82 ms |
11252 KB |
Output is correct |
69 |
Correct |
98 ms |
11124 KB |
Output is correct |
70 |
Correct |
89 ms |
11252 KB |
Output is correct |
71 |
Correct |
5 ms |
4992 KB |
Output is correct |
72 |
Correct |
7 ms |
5248 KB |
Output is correct |
73 |
Correct |
7 ms |
5248 KB |
Output is correct |
74 |
Correct |
8 ms |
5248 KB |
Output is correct |
75 |
Correct |
7 ms |
5248 KB |
Output is correct |
76 |
Correct |
7 ms |
5248 KB |
Output is correct |
77 |
Correct |
7 ms |
5248 KB |
Output is correct |
78 |
Correct |
7 ms |
5248 KB |
Output is correct |
79 |
Correct |
7 ms |
5248 KB |
Output is correct |
80 |
Correct |
78 ms |
11380 KB |
Output is correct |
81 |
Correct |
86 ms |
11252 KB |
Output is correct |
82 |
Correct |
82 ms |
11176 KB |
Output is correct |
83 |
Correct |
79 ms |
11124 KB |
Output is correct |
84 |
Correct |
6 ms |
5120 KB |
Output is correct |
85 |
Correct |
7 ms |
5120 KB |
Output is correct |
86 |
Correct |
6 ms |
5248 KB |
Output is correct |
87 |
Correct |
7 ms |
5248 KB |
Output is correct |
88 |
Correct |
9 ms |
5248 KB |
Output is correct |
89 |
Correct |
7 ms |
5248 KB |
Output is correct |
90 |
Correct |
7 ms |
5248 KB |
Output is correct |
91 |
Correct |
7 ms |
5248 KB |
Output is correct |
92 |
Correct |
7 ms |
5248 KB |
Output is correct |
93 |
Correct |
7 ms |
5120 KB |
Output is correct |
94 |
Correct |
5 ms |
4992 KB |
Output is correct |
95 |
Correct |
6 ms |
4992 KB |
Output is correct |
96 |
Correct |
6 ms |
4992 KB |
Output is correct |
97 |
Correct |
5 ms |
4992 KB |
Output is correct |
98 |
Correct |
5 ms |
4992 KB |
Output is correct |
99 |
Correct |
6 ms |
4992 KB |
Output is correct |
100 |
Correct |
6 ms |
4992 KB |
Output is correct |
101 |
Correct |
6 ms |
5040 KB |
Output is correct |
102 |
Correct |
5 ms |
4992 KB |
Output is correct |
103 |
Correct |
5 ms |
4992 KB |
Output is correct |
104 |
Correct |
12 ms |
5760 KB |
Output is correct |
105 |
Correct |
20 ms |
7040 KB |
Output is correct |
106 |
Correct |
5 ms |
4992 KB |
Output is correct |
107 |
Correct |
33 ms |
8744 KB |
Output is correct |
108 |
Correct |
43 ms |
10744 KB |
Output is correct |
109 |
Correct |
5 ms |
5120 KB |
Output is correct |
110 |
Correct |
64 ms |
11384 KB |
Output is correct |
111 |
Correct |
78 ms |
12656 KB |
Output is correct |
112 |
Correct |
6 ms |
5120 KB |
Output is correct |
113 |
Correct |
108 ms |
18024 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1074 ms |
10452 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
13812 KB |
Output is correct |
2 |
Correct |
65 ms |
13556 KB |
Output is correct |
3 |
Correct |
48 ms |
12316 KB |
Output is correct |
4 |
Correct |
13 ms |
6272 KB |
Output is correct |
5 |
Correct |
12 ms |
5760 KB |
Output is correct |
6 |
Correct |
20 ms |
7040 KB |
Output is correct |
7 |
Correct |
5 ms |
4992 KB |
Output is correct |
8 |
Correct |
34 ms |
8832 KB |
Output is correct |
9 |
Correct |
43 ms |
10744 KB |
Output is correct |
10 |
Correct |
6 ms |
5120 KB |
Output is correct |
11 |
Correct |
79 ms |
11508 KB |
Output is correct |
12 |
Correct |
66 ms |
12528 KB |
Output is correct |
13 |
Correct |
6 ms |
5120 KB |
Output is correct |
14 |
Correct |
6 ms |
5120 KB |
Output is correct |
15 |
Correct |
8 ms |
5120 KB |
Output is correct |
16 |
Correct |
10 ms |
5248 KB |
Output is correct |
17 |
Correct |
6 ms |
5120 KB |
Output is correct |
18 |
Correct |
8 ms |
5120 KB |
Output is correct |
19 |
Correct |
12 ms |
5248 KB |
Output is correct |
20 |
Correct |
6 ms |
5120 KB |
Output is correct |
21 |
Correct |
7 ms |
5120 KB |
Output is correct |
22 |
Correct |
9 ms |
5248 KB |
Output is correct |
23 |
Correct |
5 ms |
4992 KB |
Output is correct |
24 |
Correct |
6 ms |
4992 KB |
Output is correct |
25 |
Correct |
5 ms |
4992 KB |
Output is correct |
26 |
Correct |
5 ms |
4992 KB |
Output is correct |
27 |
Correct |
5 ms |
4992 KB |
Output is correct |
28 |
Correct |
6 ms |
4992 KB |
Output is correct |
29 |
Correct |
5 ms |
4992 KB |
Output is correct |
30 |
Correct |
6 ms |
4992 KB |
Output is correct |
31 |
Correct |
6 ms |
4992 KB |
Output is correct |
32 |
Correct |
5 ms |
4992 KB |
Output is correct |
33 |
Correct |
5 ms |
4992 KB |
Output is correct |
34 |
Correct |
6 ms |
4992 KB |
Output is correct |
35 |
Correct |
6 ms |
4992 KB |
Output is correct |
36 |
Correct |
6 ms |
4992 KB |
Output is correct |
37 |
Correct |
6 ms |
5120 KB |
Output is correct |
38 |
Correct |
6 ms |
5120 KB |
Output is correct |
39 |
Correct |
5 ms |
4992 KB |
Output is correct |
40 |
Correct |
5 ms |
4992 KB |
Output is correct |
41 |
Correct |
5 ms |
4992 KB |
Output is correct |
42 |
Correct |
7 ms |
5376 KB |
Output is correct |
43 |
Correct |
7 ms |
5376 KB |
Output is correct |
44 |
Correct |
14 ms |
5248 KB |
Output is correct |
45 |
Correct |
18 ms |
5248 KB |
Output is correct |
46 |
Correct |
7 ms |
5248 KB |
Output is correct |
47 |
Correct |
7 ms |
5248 KB |
Output is correct |
48 |
Correct |
15 ms |
5248 KB |
Output is correct |
49 |
Correct |
16 ms |
5248 KB |
Output is correct |
50 |
Correct |
7 ms |
5248 KB |
Output is correct |
51 |
Correct |
7 ms |
5248 KB |
Output is correct |
52 |
Correct |
18 ms |
5120 KB |
Output is correct |
53 |
Correct |
13 ms |
5248 KB |
Output is correct |
54 |
Correct |
7 ms |
5248 KB |
Output is correct |
55 |
Correct |
7 ms |
5248 KB |
Output is correct |
56 |
Correct |
13 ms |
5248 KB |
Output is correct |
57 |
Correct |
12 ms |
5248 KB |
Output is correct |
58 |
Correct |
18 ms |
5248 KB |
Output is correct |
59 |
Correct |
16 ms |
5120 KB |
Output is correct |
60 |
Correct |
7 ms |
5248 KB |
Output is correct |
61 |
Correct |
7 ms |
5248 KB |
Output is correct |
62 |
Correct |
8 ms |
5248 KB |
Output is correct |
63 |
Correct |
8 ms |
5248 KB |
Output is correct |
64 |
Correct |
7 ms |
5248 KB |
Output is correct |
65 |
Correct |
7 ms |
5248 KB |
Output is correct |
66 |
Correct |
16 ms |
5120 KB |
Output is correct |
67 |
Correct |
15 ms |
5120 KB |
Output is correct |
68 |
Correct |
19 ms |
5120 KB |
Output is correct |
69 |
Correct |
20 ms |
5120 KB |
Output is correct |
70 |
Correct |
8 ms |
5248 KB |
Output is correct |
71 |
Correct |
8 ms |
5248 KB |
Output is correct |
72 |
Correct |
16 ms |
5120 KB |
Output is correct |
73 |
Correct |
19 ms |
5120 KB |
Output is correct |
74 |
Correct |
12 ms |
5120 KB |
Output is correct |
75 |
Correct |
8 ms |
5248 KB |
Output is correct |
76 |
Correct |
12 ms |
5248 KB |
Output is correct |
77 |
Correct |
13 ms |
5248 KB |
Output is correct |
78 |
Correct |
16 ms |
5248 KB |
Output is correct |
79 |
Correct |
15 ms |
5120 KB |
Output is correct |
80 |
Correct |
6 ms |
5120 KB |
Output is correct |
81 |
Correct |
7 ms |
5248 KB |
Output is correct |
82 |
Correct |
7 ms |
5248 KB |
Output is correct |
83 |
Correct |
7 ms |
5248 KB |
Output is correct |
84 |
Correct |
7 ms |
5248 KB |
Output is correct |
85 |
Correct |
7 ms |
5248 KB |
Output is correct |
86 |
Correct |
7 ms |
5248 KB |
Output is correct |
87 |
Correct |
7 ms |
5248 KB |
Output is correct |
88 |
Correct |
7 ms |
5248 KB |
Output is correct |
89 |
Correct |
6 ms |
5248 KB |
Output is correct |
90 |
Correct |
6 ms |
5120 KB |
Output is correct |
91 |
Correct |
6 ms |
5120 KB |
Output is correct |
92 |
Correct |
6 ms |
4992 KB |
Output is correct |
93 |
Correct |
5 ms |
4992 KB |
Output is correct |
94 |
Correct |
5 ms |
4992 KB |
Output is correct |
95 |
Correct |
6 ms |
5120 KB |
Output is correct |
96 |
Correct |
6 ms |
4992 KB |
Output is correct |
97 |
Correct |
5 ms |
5120 KB |
Output is correct |
98 |
Correct |
6 ms |
4992 KB |
Output is correct |
99 |
Correct |
5 ms |
5120 KB |
Output is correct |
100 |
Correct |
6 ms |
5120 KB |
Output is correct |
101 |
Correct |
6 ms |
5120 KB |
Output is correct |
102 |
Correct |
6 ms |
5120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
13812 KB |
Output is correct |
2 |
Correct |
65 ms |
13556 KB |
Output is correct |
3 |
Correct |
48 ms |
12316 KB |
Output is correct |
4 |
Correct |
13 ms |
6272 KB |
Output is correct |
5 |
Correct |
12 ms |
5760 KB |
Output is correct |
6 |
Correct |
20 ms |
7040 KB |
Output is correct |
7 |
Correct |
5 ms |
4992 KB |
Output is correct |
8 |
Correct |
34 ms |
8832 KB |
Output is correct |
9 |
Correct |
43 ms |
10744 KB |
Output is correct |
10 |
Correct |
6 ms |
5120 KB |
Output is correct |
11 |
Correct |
79 ms |
11508 KB |
Output is correct |
12 |
Correct |
66 ms |
12528 KB |
Output is correct |
13 |
Correct |
6 ms |
5120 KB |
Output is correct |
14 |
Correct |
6 ms |
4992 KB |
Output is correct |
15 |
Correct |
6 ms |
4992 KB |
Output is correct |
16 |
Correct |
5 ms |
4992 KB |
Output is correct |
17 |
Correct |
6 ms |
4992 KB |
Output is correct |
18 |
Correct |
5 ms |
4992 KB |
Output is correct |
19 |
Correct |
5 ms |
4992 KB |
Output is correct |
20 |
Correct |
5 ms |
4992 KB |
Output is correct |
21 |
Correct |
5 ms |
4992 KB |
Output is correct |
22 |
Correct |
6 ms |
4992 KB |
Output is correct |
23 |
Correct |
6 ms |
4992 KB |
Output is correct |
24 |
Correct |
5 ms |
4992 KB |
Output is correct |
25 |
Correct |
5 ms |
4992 KB |
Output is correct |
26 |
Correct |
5 ms |
4992 KB |
Output is correct |
27 |
Correct |
5 ms |
5120 KB |
Output is correct |
28 |
Correct |
5 ms |
4992 KB |
Output is correct |
29 |
Correct |
6 ms |
4992 KB |
Output is correct |
30 |
Correct |
6 ms |
4992 KB |
Output is correct |
31 |
Correct |
6 ms |
4992 KB |
Output is correct |
32 |
Correct |
6 ms |
4992 KB |
Output is correct |
33 |
Correct |
6 ms |
4992 KB |
Output is correct |
34 |
Correct |
5 ms |
4992 KB |
Output is correct |
35 |
Correct |
6 ms |
4992 KB |
Output is correct |
36 |
Correct |
5 ms |
4992 KB |
Output is correct |
37 |
Correct |
5 ms |
4992 KB |
Output is correct |
38 |
Correct |
6 ms |
4992 KB |
Output is correct |
39 |
Correct |
74 ms |
13848 KB |
Output is correct |
40 |
Correct |
78 ms |
13524 KB |
Output is correct |
41 |
Correct |
45 ms |
12276 KB |
Output is correct |
42 |
Correct |
13 ms |
6272 KB |
Output is correct |
43 |
Correct |
6 ms |
5120 KB |
Output is correct |
44 |
Correct |
6 ms |
5120 KB |
Output is correct |
45 |
Correct |
5 ms |
4992 KB |
Output is correct |
46 |
Correct |
5 ms |
4992 KB |
Output is correct |
47 |
Correct |
5 ms |
4992 KB |
Output is correct |
48 |
Correct |
5 ms |
4992 KB |
Output is correct |
49 |
Correct |
6 ms |
4992 KB |
Output is correct |
50 |
Correct |
6 ms |
4992 KB |
Output is correct |
51 |
Correct |
6 ms |
4992 KB |
Output is correct |
52 |
Correct |
7 ms |
4992 KB |
Output is correct |
53 |
Correct |
6 ms |
4992 KB |
Output is correct |
54 |
Correct |
5 ms |
4992 KB |
Output is correct |
55 |
Correct |
5 ms |
4992 KB |
Output is correct |
56 |
Correct |
6 ms |
5108 KB |
Output is correct |
57 |
Correct |
96 ms |
11380 KB |
Output is correct |
58 |
Correct |
91 ms |
11256 KB |
Output is correct |
59 |
Correct |
112 ms |
11252 KB |
Output is correct |
60 |
Correct |
96 ms |
11124 KB |
Output is correct |
61 |
Correct |
103 ms |
11124 KB |
Output is correct |
62 |
Correct |
84 ms |
11000 KB |
Output is correct |
63 |
Correct |
78 ms |
11000 KB |
Output is correct |
64 |
Correct |
77 ms |
11000 KB |
Output is correct |
65 |
Correct |
73 ms |
11048 KB |
Output is correct |
66 |
Correct |
92 ms |
11000 KB |
Output is correct |
67 |
Correct |
80 ms |
11252 KB |
Output is correct |
68 |
Correct |
82 ms |
11252 KB |
Output is correct |
69 |
Correct |
98 ms |
11124 KB |
Output is correct |
70 |
Correct |
89 ms |
11252 KB |
Output is correct |
71 |
Correct |
5 ms |
4992 KB |
Output is correct |
72 |
Correct |
7 ms |
5248 KB |
Output is correct |
73 |
Correct |
7 ms |
5248 KB |
Output is correct |
74 |
Correct |
8 ms |
5248 KB |
Output is correct |
75 |
Correct |
7 ms |
5248 KB |
Output is correct |
76 |
Correct |
7 ms |
5248 KB |
Output is correct |
77 |
Correct |
7 ms |
5248 KB |
Output is correct |
78 |
Correct |
7 ms |
5248 KB |
Output is correct |
79 |
Correct |
7 ms |
5248 KB |
Output is correct |
80 |
Correct |
78 ms |
11380 KB |
Output is correct |
81 |
Correct |
86 ms |
11252 KB |
Output is correct |
82 |
Correct |
82 ms |
11176 KB |
Output is correct |
83 |
Correct |
79 ms |
11124 KB |
Output is correct |
84 |
Correct |
6 ms |
5120 KB |
Output is correct |
85 |
Correct |
7 ms |
5120 KB |
Output is correct |
86 |
Correct |
6 ms |
5248 KB |
Output is correct |
87 |
Correct |
7 ms |
5248 KB |
Output is correct |
88 |
Correct |
9 ms |
5248 KB |
Output is correct |
89 |
Correct |
7 ms |
5248 KB |
Output is correct |
90 |
Correct |
7 ms |
5248 KB |
Output is correct |
91 |
Correct |
7 ms |
5248 KB |
Output is correct |
92 |
Correct |
7 ms |
5248 KB |
Output is correct |
93 |
Correct |
7 ms |
5120 KB |
Output is correct |
94 |
Correct |
5 ms |
4992 KB |
Output is correct |
95 |
Correct |
6 ms |
4992 KB |
Output is correct |
96 |
Correct |
6 ms |
4992 KB |
Output is correct |
97 |
Correct |
5 ms |
4992 KB |
Output is correct |
98 |
Correct |
5 ms |
4992 KB |
Output is correct |
99 |
Correct |
6 ms |
4992 KB |
Output is correct |
100 |
Correct |
6 ms |
4992 KB |
Output is correct |
101 |
Correct |
6 ms |
5040 KB |
Output is correct |
102 |
Correct |
5 ms |
4992 KB |
Output is correct |
103 |
Correct |
5 ms |
4992 KB |
Output is correct |
104 |
Correct |
12 ms |
5760 KB |
Output is correct |
105 |
Correct |
20 ms |
7040 KB |
Output is correct |
106 |
Correct |
5 ms |
4992 KB |
Output is correct |
107 |
Correct |
33 ms |
8744 KB |
Output is correct |
108 |
Correct |
43 ms |
10744 KB |
Output is correct |
109 |
Correct |
5 ms |
5120 KB |
Output is correct |
110 |
Correct |
64 ms |
11384 KB |
Output is correct |
111 |
Correct |
78 ms |
12656 KB |
Output is correct |
112 |
Correct |
6 ms |
5120 KB |
Output is correct |
113 |
Correct |
108 ms |
18024 KB |
Output is correct |
114 |
Execution timed out |
1074 ms |
10452 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |