#include <bits/stdc++.h>
#include "dreaming.h"
using namespace std;
int k = 0, M;
void DFS_sum(int node, int p, vector<int> &sum, vector<vector<int>> &vec, vector<vector<int>> &cost, vector<int> &col)
{
col[node] = k;
for (int i = 0; i < vec[node].size(); i++)
{
if (vec[node][i] == p)
continue;
DFS_sum(vec[node][i], node, sum, vec, cost, col);
sum[node] = max(sum[node], sum[vec[node][i]] + cost[node][i]);
}
}
void DFS_main(int node, int p, int main, int sec, vector<int> &sum, int &ans, vector<vector<int>> &vec, vector<vector<int>> &cost)
{
M = max(M, main + sec);
ans = min(ans, max(main, sec));
if (main == 0)
return;
int nr = 0;
for (int i = 0; i < vec[node].size(); i++)
{
if (vec[node][i] == p)
continue;
int temp = sum[vec[node][i]] + cost[node][i];
if (temp == main)
{
nr++;
continue;
}
if (temp > sec && (temp != main || nr >= 1))
sec = temp;
}
M = max(M, main + sec);
for (int i = 0; i < vec[node].size(); i++)
{
if (vec[node][i] == p)
continue;
int temp = sum[vec[node][i]] + cost[node][i];
if (temp == main)
DFS_main(vec[node][i], node, main - cost[node][i], sec + cost[node][i], sum, ans, vec, cost);
}
}
int trace(int node, int p, int main, vector<int> &sum, vector<vector<int>> &vec, vector<vector<int>> &cost)
{
for (int i = 0; i < vec[node].size(); i++)
{
if (vec[node][i] == p)
continue;
if (sum[vec[node][i]] + cost[node][i] == main)
return trace(vec[node][i], node, main - cost[node][i], sum, vec, cost);
}
return node;
}
pair<int, int> graph_hub(int node, vector<vector<int>> &vec, vector<vector<int>> &cost, vector<int> &col)
{
vector<int> sum(vec.size(), 0);
DFS_sum(node, -1, sum, vec, cost, col);
M = 0;
int MAX = 0, sec = 0;
for (int i = 0; i < vec[node].size(); i++)
{
int temp = sum[vec[node][i]] + cost[node][i];
if (temp > MAX)
{
sec = MAX;
MAX = temp;
}
else
sec = max(sec, temp);
}
int ans = sum[node];
DFS_main(node, -1, MAX, sec, sum, ans, vec, cost);
return make_pair(ans, M);
}
int travelTime(int N, int M, int L, int A[], int B[], int C[])
{
vector<int> col(N, -1);
vector<vector<int>> vec(N), cost(N);
for (int i = 0; i < M; i++)
{
vec[A[i]].push_back(B[i]);
vec[B[i]].push_back(A[i]);
cost[A[i]].push_back(C[i]);
cost[B[i]].push_back(C[i]);
}
if (M == N - 1)
{
vector<int> sum(N, 0);
DFS_sum(0, -1, sum, vec, cost, col);
int colt = trace(0, -1, sum[0], sum, vec, cost);
vector<int> new_sum(vec.size(), 0);
DFS_sum(colt, -1, new_sum, vec, cost, col);
return new_sum[colt];
}
vector<pair<int, int>> hub_l;
for (int i = 0; i < N; i++)
if (col[i] == -1)
{
hub_l.push_back(graph_hub(i, vec, cost, col));
k++;
}
int unos = 0, dos = 0, tres = 0;
for (int i = 0; i < hub_l.size(); i++)
{
int p = hub_l[i].first;
if (p > unos)
{
tres = dos;
dos = unos;
unos = p;
}
else
if (p > dos)
{
tres = dos;
dos = p;
}
else
tres = max(tres, p);
}
int Max = 0;
for (int i = 0; i < hub_l.size(); i++)
Max = max(Max, hub_l[i].second);
if (M == N - 2)
return max(unos + L + dos, Max);
return max(unos + L + dos, max(Max, dos + 2 * L + tres));
}
Compilation message
dreaming.cpp: In function 'void DFS_sum(int, int, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, std::vector<int>&)':
dreaming.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
9 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'void DFS_main(int, int, int, int, std::vector<int>&, int&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
dreaming.cpp:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:41:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
41 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int trace(int, int, int, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
dreaming.cpp:54:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
54 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'std::pair<int, int> graph_hub(int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, std::vector<int>&)':
dreaming.cpp:74:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
74 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:127:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
127 | for (int i = 0; i < hub_l.size(); i++)
| ~~^~~~~~~~~~~~~~
dreaming.cpp:147:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
147 | for (int i = 0; i < hub_l.size(); i++)
| ~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
18412 KB |
Output is correct |
2 |
Correct |
46 ms |
18056 KB |
Output is correct |
3 |
Correct |
46 ms |
14436 KB |
Output is correct |
4 |
Correct |
7 ms |
3160 KB |
Output is correct |
5 |
Correct |
5 ms |
2136 KB |
Output is correct |
6 |
Correct |
11 ms |
4444 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
26 ms |
8124 KB |
Output is correct |
9 |
Correct |
47 ms |
11640 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
62 ms |
14012 KB |
Output is correct |
12 |
Correct |
48 ms |
16096 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
440 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
18412 KB |
Output is correct |
2 |
Correct |
46 ms |
18056 KB |
Output is correct |
3 |
Correct |
46 ms |
14436 KB |
Output is correct |
4 |
Correct |
7 ms |
3160 KB |
Output is correct |
5 |
Correct |
5 ms |
2136 KB |
Output is correct |
6 |
Correct |
11 ms |
4444 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
26 ms |
8124 KB |
Output is correct |
9 |
Correct |
47 ms |
11640 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
62 ms |
14012 KB |
Output is correct |
12 |
Correct |
48 ms |
16096 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
440 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
45 ms |
18664 KB |
Output is correct |
40 |
Correct |
48 ms |
18004 KB |
Output is correct |
41 |
Correct |
38 ms |
14436 KB |
Output is correct |
42 |
Correct |
6 ms |
3164 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
420 KB |
Output is correct |
48 |
Correct |
1 ms |
344 KB |
Output is correct |
49 |
Correct |
0 ms |
344 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
54 ms |
14280 KB |
Output is correct |
58 |
Correct |
85 ms |
14284 KB |
Output is correct |
59 |
Correct |
46 ms |
14536 KB |
Output is correct |
60 |
Correct |
66 ms |
14736 KB |
Output is correct |
61 |
Correct |
59 ms |
14604 KB |
Output is correct |
62 |
Correct |
64 ms |
14536 KB |
Output is correct |
63 |
Correct |
66 ms |
14416 KB |
Output is correct |
64 |
Correct |
46 ms |
14496 KB |
Output is correct |
65 |
Correct |
52 ms |
14420 KB |
Output is correct |
66 |
Correct |
47 ms |
14428 KB |
Output is correct |
67 |
Correct |
62 ms |
14528 KB |
Output is correct |
68 |
Correct |
48 ms |
14428 KB |
Output is correct |
69 |
Correct |
51 ms |
14412 KB |
Output is correct |
70 |
Correct |
48 ms |
14416 KB |
Output is correct |
71 |
Correct |
0 ms |
544 KB |
Output is correct |
72 |
Correct |
1 ms |
860 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
2 ms |
856 KB |
Output is correct |
75 |
Correct |
2 ms |
856 KB |
Output is correct |
76 |
Correct |
1 ms |
860 KB |
Output is correct |
77 |
Correct |
1 ms |
860 KB |
Output is correct |
78 |
Correct |
2 ms |
860 KB |
Output is correct |
79 |
Correct |
2 ms |
708 KB |
Output is correct |
80 |
Correct |
50 ms |
14460 KB |
Output is correct |
81 |
Correct |
50 ms |
14416 KB |
Output is correct |
82 |
Correct |
50 ms |
14520 KB |
Output is correct |
83 |
Correct |
57 ms |
14540 KB |
Output is correct |
84 |
Correct |
1 ms |
604 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
604 KB |
Output is correct |
87 |
Correct |
2 ms |
604 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
600 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
688 KB |
Output is correct |
92 |
Correct |
2 ms |
604 KB |
Output is correct |
93 |
Correct |
2 ms |
604 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
0 ms |
348 KB |
Output is correct |
100 |
Correct |
1 ms |
348 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
448 KB |
Output is correct |
103 |
Correct |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
5 ms |
2140 KB |
Output is correct |
105 |
Correct |
11 ms |
4444 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
21 ms |
8220 KB |
Output is correct |
108 |
Correct |
27 ms |
11672 KB |
Output is correct |
109 |
Correct |
1 ms |
348 KB |
Output is correct |
110 |
Correct |
44 ms |
13828 KB |
Output is correct |
111 |
Correct |
50 ms |
16108 KB |
Output is correct |
112 |
Correct |
1 ms |
604 KB |
Output is correct |
113 |
Correct |
72 ms |
25172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
308 ms |
10976 KB |
Output is correct |
2 |
Correct |
315 ms |
10976 KB |
Output is correct |
3 |
Correct |
301 ms |
10980 KB |
Output is correct |
4 |
Correct |
273 ms |
11068 KB |
Output is correct |
5 |
Correct |
281 ms |
11232 KB |
Output is correct |
6 |
Correct |
329 ms |
11980 KB |
Output is correct |
7 |
Correct |
314 ms |
11372 KB |
Output is correct |
8 |
Correct |
334 ms |
10864 KB |
Output is correct |
9 |
Correct |
284 ms |
10704 KB |
Output is correct |
10 |
Correct |
290 ms |
11216 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
461 ms |
7080 KB |
Output is correct |
13 |
Correct |
503 ms |
7024 KB |
Output is correct |
14 |
Correct |
471 ms |
7004 KB |
Output is correct |
15 |
Correct |
445 ms |
7120 KB |
Output is correct |
16 |
Correct |
482 ms |
6856 KB |
Output is correct |
17 |
Correct |
454 ms |
7212 KB |
Output is correct |
18 |
Correct |
442 ms |
7048 KB |
Output is correct |
19 |
Correct |
502 ms |
6976 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
448 KB |
Output is correct |
23 |
Correct |
461 ms |
7116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
440 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
448 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
2 ms |
860 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
968 KB |
Output is correct |
34 |
Correct |
2 ms |
856 KB |
Output is correct |
35 |
Correct |
0 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
444 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
344 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
2 ms |
1116 KB |
Output is correct |
55 |
Correct |
2 ms |
1116 KB |
Output is correct |
56 |
Correct |
2 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
2 ms |
856 KB |
Output is correct |
59 |
Correct |
2 ms |
860 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
600 KB |
Output is correct |
62 |
Correct |
1 ms |
860 KB |
Output is correct |
63 |
Correct |
1 ms |
860 KB |
Output is correct |
64 |
Correct |
1 ms |
604 KB |
Output is correct |
65 |
Correct |
1 ms |
604 KB |
Output is correct |
66 |
Correct |
1 ms |
860 KB |
Output is correct |
67 |
Correct |
1 ms |
860 KB |
Output is correct |
68 |
Correct |
2 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
604 KB |
Output is correct |
70 |
Correct |
1 ms |
604 KB |
Output is correct |
71 |
Correct |
1 ms |
716 KB |
Output is correct |
72 |
Correct |
1 ms |
860 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
2 ms |
860 KB |
Output is correct |
75 |
Correct |
2 ms |
756 KB |
Output is correct |
76 |
Correct |
2 ms |
856 KB |
Output is correct |
77 |
Correct |
2 ms |
752 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
1 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
708 KB |
Output is correct |
83 |
Correct |
1 ms |
860 KB |
Output is correct |
84 |
Correct |
1 ms |
708 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
604 KB |
Output is correct |
87 |
Correct |
2 ms |
1112 KB |
Output is correct |
88 |
Correct |
2 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
1 ms |
604 KB |
Output is correct |
92 |
Correct |
1 ms |
604 KB |
Output is correct |
93 |
Correct |
1 ms |
600 KB |
Output is correct |
94 |
Correct |
1 ms |
600 KB |
Output is correct |
95 |
Correct |
1 ms |
604 KB |
Output is correct |
96 |
Correct |
1 ms |
604 KB |
Output is correct |
97 |
Correct |
1 ms |
604 KB |
Output is correct |
98 |
Correct |
2 ms |
604 KB |
Output is correct |
99 |
Correct |
1 ms |
860 KB |
Output is correct |
100 |
Correct |
2 ms |
600 KB |
Output is correct |
101 |
Correct |
1 ms |
604 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
440 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Correct |
1 ms |
352 KB |
Output is correct |
110 |
Correct |
0 ms |
352 KB |
Output is correct |
111 |
Correct |
0 ms |
352 KB |
Output is correct |
112 |
Correct |
1 ms |
352 KB |
Output is correct |
113 |
Correct |
1 ms |
352 KB |
Output is correct |
114 |
Correct |
1 ms |
608 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
18412 KB |
Output is correct |
2 |
Correct |
46 ms |
18056 KB |
Output is correct |
3 |
Correct |
46 ms |
14436 KB |
Output is correct |
4 |
Correct |
7 ms |
3160 KB |
Output is correct |
5 |
Correct |
5 ms |
2136 KB |
Output is correct |
6 |
Correct |
11 ms |
4444 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
26 ms |
8124 KB |
Output is correct |
9 |
Correct |
47 ms |
11640 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
62 ms |
14012 KB |
Output is correct |
12 |
Correct |
48 ms |
16096 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
440 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
45 ms |
18664 KB |
Output is correct |
40 |
Correct |
48 ms |
18004 KB |
Output is correct |
41 |
Correct |
38 ms |
14436 KB |
Output is correct |
42 |
Correct |
6 ms |
3164 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
420 KB |
Output is correct |
48 |
Correct |
1 ms |
344 KB |
Output is correct |
49 |
Correct |
0 ms |
344 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
54 ms |
14280 KB |
Output is correct |
58 |
Correct |
85 ms |
14284 KB |
Output is correct |
59 |
Correct |
46 ms |
14536 KB |
Output is correct |
60 |
Correct |
66 ms |
14736 KB |
Output is correct |
61 |
Correct |
59 ms |
14604 KB |
Output is correct |
62 |
Correct |
64 ms |
14536 KB |
Output is correct |
63 |
Correct |
66 ms |
14416 KB |
Output is correct |
64 |
Correct |
46 ms |
14496 KB |
Output is correct |
65 |
Correct |
52 ms |
14420 KB |
Output is correct |
66 |
Correct |
47 ms |
14428 KB |
Output is correct |
67 |
Correct |
62 ms |
14528 KB |
Output is correct |
68 |
Correct |
48 ms |
14428 KB |
Output is correct |
69 |
Correct |
51 ms |
14412 KB |
Output is correct |
70 |
Correct |
48 ms |
14416 KB |
Output is correct |
71 |
Correct |
0 ms |
544 KB |
Output is correct |
72 |
Correct |
1 ms |
860 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
2 ms |
856 KB |
Output is correct |
75 |
Correct |
2 ms |
856 KB |
Output is correct |
76 |
Correct |
1 ms |
860 KB |
Output is correct |
77 |
Correct |
1 ms |
860 KB |
Output is correct |
78 |
Correct |
2 ms |
860 KB |
Output is correct |
79 |
Correct |
2 ms |
708 KB |
Output is correct |
80 |
Correct |
50 ms |
14460 KB |
Output is correct |
81 |
Correct |
50 ms |
14416 KB |
Output is correct |
82 |
Correct |
50 ms |
14520 KB |
Output is correct |
83 |
Correct |
57 ms |
14540 KB |
Output is correct |
84 |
Correct |
1 ms |
604 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
604 KB |
Output is correct |
87 |
Correct |
2 ms |
604 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
600 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
688 KB |
Output is correct |
92 |
Correct |
2 ms |
604 KB |
Output is correct |
93 |
Correct |
2 ms |
604 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
0 ms |
348 KB |
Output is correct |
100 |
Correct |
1 ms |
348 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
448 KB |
Output is correct |
103 |
Correct |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
5 ms |
2140 KB |
Output is correct |
105 |
Correct |
11 ms |
4444 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
21 ms |
8220 KB |
Output is correct |
108 |
Correct |
27 ms |
11672 KB |
Output is correct |
109 |
Correct |
1 ms |
348 KB |
Output is correct |
110 |
Correct |
44 ms |
13828 KB |
Output is correct |
111 |
Correct |
50 ms |
16108 KB |
Output is correct |
112 |
Correct |
1 ms |
604 KB |
Output is correct |
113 |
Correct |
72 ms |
25172 KB |
Output is correct |
114 |
Correct |
308 ms |
10976 KB |
Output is correct |
115 |
Correct |
315 ms |
10976 KB |
Output is correct |
116 |
Correct |
301 ms |
10980 KB |
Output is correct |
117 |
Correct |
273 ms |
11068 KB |
Output is correct |
118 |
Correct |
281 ms |
11232 KB |
Output is correct |
119 |
Correct |
329 ms |
11980 KB |
Output is correct |
120 |
Correct |
314 ms |
11372 KB |
Output is correct |
121 |
Correct |
334 ms |
10864 KB |
Output is correct |
122 |
Correct |
284 ms |
10704 KB |
Output is correct |
123 |
Correct |
290 ms |
11216 KB |
Output is correct |
124 |
Correct |
0 ms |
348 KB |
Output is correct |
125 |
Correct |
461 ms |
7080 KB |
Output is correct |
126 |
Correct |
503 ms |
7024 KB |
Output is correct |
127 |
Correct |
471 ms |
7004 KB |
Output is correct |
128 |
Correct |
445 ms |
7120 KB |
Output is correct |
129 |
Correct |
482 ms |
6856 KB |
Output is correct |
130 |
Correct |
454 ms |
7212 KB |
Output is correct |
131 |
Correct |
442 ms |
7048 KB |
Output is correct |
132 |
Correct |
502 ms |
6976 KB |
Output is correct |
133 |
Correct |
0 ms |
344 KB |
Output is correct |
134 |
Correct |
0 ms |
348 KB |
Output is correct |
135 |
Correct |
1 ms |
448 KB |
Output is correct |
136 |
Correct |
461 ms |
7116 KB |
Output is correct |
137 |
Correct |
1 ms |
348 KB |
Output is correct |
138 |
Correct |
1 ms |
604 KB |
Output is correct |
139 |
Correct |
1 ms |
860 KB |
Output is correct |
140 |
Correct |
1 ms |
448 KB |
Output is correct |
141 |
Correct |
1 ms |
604 KB |
Output is correct |
142 |
Correct |
2 ms |
860 KB |
Output is correct |
143 |
Correct |
1 ms |
348 KB |
Output is correct |
144 |
Correct |
1 ms |
968 KB |
Output is correct |
145 |
Correct |
2 ms |
856 KB |
Output is correct |
146 |
Correct |
0 ms |
344 KB |
Output is correct |
147 |
Correct |
0 ms |
348 KB |
Output is correct |
148 |
Correct |
0 ms |
348 KB |
Output is correct |
149 |
Correct |
0 ms |
348 KB |
Output is correct |
150 |
Correct |
0 ms |
348 KB |
Output is correct |
151 |
Correct |
0 ms |
348 KB |
Output is correct |
152 |
Correct |
1 ms |
348 KB |
Output is correct |
153 |
Correct |
0 ms |
444 KB |
Output is correct |
154 |
Correct |
0 ms |
344 KB |
Output is correct |
155 |
Correct |
0 ms |
348 KB |
Output is correct |
156 |
Correct |
0 ms |
348 KB |
Output is correct |
157 |
Correct |
0 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
344 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Correct |
0 ms |
348 KB |
Output is correct |
162 |
Correct |
1 ms |
348 KB |
Output is correct |
163 |
Correct |
0 ms |
348 KB |
Output is correct |
164 |
Correct |
0 ms |
348 KB |
Output is correct |
165 |
Correct |
2 ms |
1116 KB |
Output is correct |
166 |
Correct |
2 ms |
1116 KB |
Output is correct |
167 |
Correct |
2 ms |
604 KB |
Output is correct |
168 |
Correct |
1 ms |
604 KB |
Output is correct |
169 |
Correct |
2 ms |
856 KB |
Output is correct |
170 |
Correct |
2 ms |
860 KB |
Output is correct |
171 |
Correct |
1 ms |
604 KB |
Output is correct |
172 |
Correct |
1 ms |
600 KB |
Output is correct |
173 |
Correct |
1 ms |
860 KB |
Output is correct |
174 |
Correct |
1 ms |
860 KB |
Output is correct |
175 |
Correct |
1 ms |
604 KB |
Output is correct |
176 |
Correct |
1 ms |
604 KB |
Output is correct |
177 |
Correct |
1 ms |
860 KB |
Output is correct |
178 |
Correct |
1 ms |
860 KB |
Output is correct |
179 |
Correct |
2 ms |
604 KB |
Output is correct |
180 |
Correct |
1 ms |
604 KB |
Output is correct |
181 |
Correct |
1 ms |
604 KB |
Output is correct |
182 |
Correct |
1 ms |
716 KB |
Output is correct |
183 |
Correct |
1 ms |
860 KB |
Output is correct |
184 |
Correct |
2 ms |
860 KB |
Output is correct |
185 |
Correct |
2 ms |
860 KB |
Output is correct |
186 |
Correct |
2 ms |
756 KB |
Output is correct |
187 |
Correct |
2 ms |
856 KB |
Output is correct |
188 |
Correct |
2 ms |
752 KB |
Output is correct |
189 |
Correct |
1 ms |
604 KB |
Output is correct |
190 |
Correct |
1 ms |
604 KB |
Output is correct |
191 |
Correct |
1 ms |
604 KB |
Output is correct |
192 |
Correct |
1 ms |
604 KB |
Output is correct |
193 |
Correct |
1 ms |
708 KB |
Output is correct |
194 |
Correct |
1 ms |
860 KB |
Output is correct |
195 |
Correct |
1 ms |
708 KB |
Output is correct |
196 |
Correct |
1 ms |
604 KB |
Output is correct |
197 |
Correct |
1 ms |
604 KB |
Output is correct |
198 |
Correct |
2 ms |
1112 KB |
Output is correct |
199 |
Correct |
2 ms |
604 KB |
Output is correct |
200 |
Correct |
1 ms |
604 KB |
Output is correct |
201 |
Correct |
1 ms |
604 KB |
Output is correct |
202 |
Correct |
1 ms |
604 KB |
Output is correct |
203 |
Correct |
1 ms |
604 KB |
Output is correct |
204 |
Correct |
1 ms |
600 KB |
Output is correct |
205 |
Correct |
1 ms |
600 KB |
Output is correct |
206 |
Correct |
1 ms |
604 KB |
Output is correct |
207 |
Correct |
1 ms |
604 KB |
Output is correct |
208 |
Correct |
1 ms |
604 KB |
Output is correct |
209 |
Correct |
2 ms |
604 KB |
Output is correct |
210 |
Correct |
1 ms |
860 KB |
Output is correct |
211 |
Correct |
2 ms |
600 KB |
Output is correct |
212 |
Correct |
1 ms |
604 KB |
Output is correct |
213 |
Correct |
0 ms |
348 KB |
Output is correct |
214 |
Correct |
0 ms |
440 KB |
Output is correct |
215 |
Correct |
0 ms |
348 KB |
Output is correct |
216 |
Correct |
0 ms |
348 KB |
Output is correct |
217 |
Correct |
1 ms |
348 KB |
Output is correct |
218 |
Correct |
0 ms |
348 KB |
Output is correct |
219 |
Correct |
0 ms |
348 KB |
Output is correct |
220 |
Correct |
1 ms |
352 KB |
Output is correct |
221 |
Correct |
0 ms |
352 KB |
Output is correct |
222 |
Correct |
0 ms |
352 KB |
Output is correct |
223 |
Correct |
1 ms |
352 KB |
Output is correct |
224 |
Correct |
1 ms |
352 KB |
Output is correct |
225 |
Correct |
1 ms |
608 KB |
Output is correct |
226 |
Correct |
1 ms |
352 KB |
Output is correct |
227 |
Correct |
1 ms |
608 KB |
Output is correct |
228 |
Correct |
2 ms |
864 KB |
Output is correct |
229 |
Incorrect |
103 ms |
11524 KB |
Output isn't correct |
230 |
Halted |
0 ms |
0 KB |
- |