#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 (sec > main)
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:10:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
10 | 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:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
27 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:42:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
42 | 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:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
55 | 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:75:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
75 | for (int i = 0; i < vec[node].size(); i++)
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:128: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]
128 | for (int i = 0; i < hub_l.size(); i++)
| ~~^~~~~~~~~~~~~~
dreaming.cpp:148: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]
148 | for (int i = 0; i < hub_l.size(); i++)
| ~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
16960 KB |
Output is correct |
2 |
Correct |
43 ms |
16520 KB |
Output is correct |
3 |
Correct |
29 ms |
12900 KB |
Output is correct |
4 |
Correct |
6 ms |
2652 KB |
Output is correct |
5 |
Correct |
4 ms |
1884 KB |
Output is correct |
6 |
Correct |
10 ms |
3932 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
20 ms |
7252 KB |
Output is correct |
9 |
Correct |
26 ms |
10392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
38 ms |
12536 KB |
Output is correct |
12 |
Correct |
45 ms |
14572 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
16960 KB |
Output is correct |
2 |
Correct |
43 ms |
16520 KB |
Output is correct |
3 |
Correct |
29 ms |
12900 KB |
Output is correct |
4 |
Correct |
6 ms |
2652 KB |
Output is correct |
5 |
Correct |
4 ms |
1884 KB |
Output is correct |
6 |
Correct |
10 ms |
3932 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
20 ms |
7252 KB |
Output is correct |
9 |
Correct |
26 ms |
10392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
38 ms |
12536 KB |
Output is correct |
12 |
Correct |
45 ms |
14572 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 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 |
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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 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 |
0 ms |
348 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 |
348 KB |
Output is correct |
39 |
Correct |
47 ms |
16884 KB |
Output is correct |
40 |
Correct |
44 ms |
16564 KB |
Output is correct |
41 |
Correct |
30 ms |
12924 KB |
Output is correct |
42 |
Correct |
6 ms |
2652 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
344 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
55 ms |
13276 KB |
Output is correct |
58 |
Correct |
72 ms |
13256 KB |
Output is correct |
59 |
Correct |
68 ms |
13396 KB |
Output is correct |
60 |
Correct |
54 ms |
13392 KB |
Output is correct |
61 |
Correct |
52 ms |
13516 KB |
Output is correct |
62 |
Correct |
72 ms |
13508 KB |
Output is correct |
63 |
Correct |
60 ms |
13372 KB |
Output is correct |
64 |
Correct |
48 ms |
13472 KB |
Output is correct |
65 |
Correct |
56 ms |
13416 KB |
Output is correct |
66 |
Correct |
51 ms |
13588 KB |
Output is correct |
67 |
Correct |
64 ms |
13404 KB |
Output is correct |
68 |
Correct |
69 ms |
13472 KB |
Output is correct |
69 |
Correct |
53 ms |
13448 KB |
Output is correct |
70 |
Correct |
64 ms |
13460 KB |
Output is correct |
71 |
Correct |
0 ms |
600 KB |
Output is correct |
72 |
Correct |
1 ms |
600 KB |
Output is correct |
73 |
Correct |
2 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
2 ms |
604 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
2 ms |
604 KB |
Output is correct |
80 |
Correct |
92 ms |
13392 KB |
Output is correct |
81 |
Correct |
57 ms |
13372 KB |
Output is correct |
82 |
Correct |
78 ms |
13788 KB |
Output is correct |
83 |
Correct |
51 ms |
13512 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 |
1 ms |
732 KB |
Output is correct |
88 |
Correct |
1 ms |
600 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
604 KB |
Output is correct |
92 |
Correct |
1 ms |
604 KB |
Output is correct |
93 |
Correct |
1 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 |
344 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 |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
5 ms |
1884 KB |
Output is correct |
105 |
Correct |
10 ms |
3932 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
20 ms |
7264 KB |
Output is correct |
108 |
Correct |
27 ms |
10392 KB |
Output is correct |
109 |
Correct |
0 ms |
344 KB |
Output is correct |
110 |
Correct |
39 ms |
12372 KB |
Output is correct |
111 |
Correct |
59 ms |
14652 KB |
Output is correct |
112 |
Correct |
1 ms |
348 KB |
Output is correct |
113 |
Correct |
79 ms |
22544 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
294 ms |
10400 KB |
Output is correct |
2 |
Correct |
303 ms |
10488 KB |
Output is correct |
3 |
Correct |
274 ms |
10616 KB |
Output is correct |
4 |
Correct |
297 ms |
10468 KB |
Output is correct |
5 |
Correct |
294 ms |
10588 KB |
Output is correct |
6 |
Correct |
323 ms |
11468 KB |
Output is correct |
7 |
Correct |
333 ms |
10964 KB |
Output is correct |
8 |
Correct |
274 ms |
10320 KB |
Output is correct |
9 |
Correct |
293 ms |
10380 KB |
Output is correct |
10 |
Correct |
322 ms |
10964 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
476 ms |
7316 KB |
Output is correct |
13 |
Correct |
461 ms |
7044 KB |
Output is correct |
14 |
Correct |
460 ms |
6984 KB |
Output is correct |
15 |
Correct |
449 ms |
7112 KB |
Output is correct |
16 |
Correct |
459 ms |
7008 KB |
Output is correct |
17 |
Correct |
500 ms |
6856 KB |
Output is correct |
18 |
Correct |
470 ms |
7108 KB |
Output is correct |
19 |
Correct |
462 ms |
6972 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
604 KB |
Output is correct |
23 |
Correct |
463 ms |
7044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
2 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
344 KB |
Output is correct |
42 |
Correct |
0 ms |
344 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 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 |
2 ms |
860 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
1 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
604 KB |
Output is correct |
70 |
Correct |
2 ms |
604 KB |
Output is correct |
71 |
Correct |
1 ms |
604 KB |
Output is correct |
72 |
Correct |
1 ms |
604 KB |
Output is correct |
73 |
Correct |
1 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
2 ms |
604 KB |
Output is correct |
77 |
Correct |
1 ms |
600 KB |
Output is correct |
78 |
Correct |
2 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 |
600 KB |
Output is correct |
83 |
Correct |
2 ms |
604 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 |
1 ms |
604 KB |
Output is correct |
88 |
Correct |
1 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 |
604 KB |
Output is correct |
94 |
Correct |
2 ms |
604 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 |
744 KB |
Output is correct |
98 |
Correct |
1 ms |
604 KB |
Output is correct |
99 |
Correct |
1 ms |
604 KB |
Output is correct |
100 |
Correct |
1 ms |
604 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 |
348 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
356 KB |
Output is correct |
112 |
Correct |
0 ms |
352 KB |
Output is correct |
113 |
Correct |
1 ms |
356 KB |
Output is correct |
114 |
Correct |
1 ms |
356 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
16960 KB |
Output is correct |
2 |
Correct |
43 ms |
16520 KB |
Output is correct |
3 |
Correct |
29 ms |
12900 KB |
Output is correct |
4 |
Correct |
6 ms |
2652 KB |
Output is correct |
5 |
Correct |
4 ms |
1884 KB |
Output is correct |
6 |
Correct |
10 ms |
3932 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
20 ms |
7252 KB |
Output is correct |
9 |
Correct |
26 ms |
10392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
38 ms |
12536 KB |
Output is correct |
12 |
Correct |
45 ms |
14572 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 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 |
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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 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 |
0 ms |
348 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 |
348 KB |
Output is correct |
39 |
Correct |
47 ms |
16884 KB |
Output is correct |
40 |
Correct |
44 ms |
16564 KB |
Output is correct |
41 |
Correct |
30 ms |
12924 KB |
Output is correct |
42 |
Correct |
6 ms |
2652 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
344 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
55 ms |
13276 KB |
Output is correct |
58 |
Correct |
72 ms |
13256 KB |
Output is correct |
59 |
Correct |
68 ms |
13396 KB |
Output is correct |
60 |
Correct |
54 ms |
13392 KB |
Output is correct |
61 |
Correct |
52 ms |
13516 KB |
Output is correct |
62 |
Correct |
72 ms |
13508 KB |
Output is correct |
63 |
Correct |
60 ms |
13372 KB |
Output is correct |
64 |
Correct |
48 ms |
13472 KB |
Output is correct |
65 |
Correct |
56 ms |
13416 KB |
Output is correct |
66 |
Correct |
51 ms |
13588 KB |
Output is correct |
67 |
Correct |
64 ms |
13404 KB |
Output is correct |
68 |
Correct |
69 ms |
13472 KB |
Output is correct |
69 |
Correct |
53 ms |
13448 KB |
Output is correct |
70 |
Correct |
64 ms |
13460 KB |
Output is correct |
71 |
Correct |
0 ms |
600 KB |
Output is correct |
72 |
Correct |
1 ms |
600 KB |
Output is correct |
73 |
Correct |
2 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
2 ms |
604 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
2 ms |
604 KB |
Output is correct |
80 |
Correct |
92 ms |
13392 KB |
Output is correct |
81 |
Correct |
57 ms |
13372 KB |
Output is correct |
82 |
Correct |
78 ms |
13788 KB |
Output is correct |
83 |
Correct |
51 ms |
13512 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 |
1 ms |
732 KB |
Output is correct |
88 |
Correct |
1 ms |
600 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
604 KB |
Output is correct |
92 |
Correct |
1 ms |
604 KB |
Output is correct |
93 |
Correct |
1 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 |
344 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 |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
5 ms |
1884 KB |
Output is correct |
105 |
Correct |
10 ms |
3932 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
20 ms |
7264 KB |
Output is correct |
108 |
Correct |
27 ms |
10392 KB |
Output is correct |
109 |
Correct |
0 ms |
344 KB |
Output is correct |
110 |
Correct |
39 ms |
12372 KB |
Output is correct |
111 |
Correct |
59 ms |
14652 KB |
Output is correct |
112 |
Correct |
1 ms |
348 KB |
Output is correct |
113 |
Correct |
79 ms |
22544 KB |
Output is correct |
114 |
Correct |
294 ms |
10400 KB |
Output is correct |
115 |
Correct |
303 ms |
10488 KB |
Output is correct |
116 |
Correct |
274 ms |
10616 KB |
Output is correct |
117 |
Correct |
297 ms |
10468 KB |
Output is correct |
118 |
Correct |
294 ms |
10588 KB |
Output is correct |
119 |
Correct |
323 ms |
11468 KB |
Output is correct |
120 |
Correct |
333 ms |
10964 KB |
Output is correct |
121 |
Correct |
274 ms |
10320 KB |
Output is correct |
122 |
Correct |
293 ms |
10380 KB |
Output is correct |
123 |
Correct |
322 ms |
10964 KB |
Output is correct |
124 |
Correct |
0 ms |
348 KB |
Output is correct |
125 |
Correct |
476 ms |
7316 KB |
Output is correct |
126 |
Correct |
461 ms |
7044 KB |
Output is correct |
127 |
Correct |
460 ms |
6984 KB |
Output is correct |
128 |
Correct |
449 ms |
7112 KB |
Output is correct |
129 |
Correct |
459 ms |
7008 KB |
Output is correct |
130 |
Correct |
500 ms |
6856 KB |
Output is correct |
131 |
Correct |
470 ms |
7108 KB |
Output is correct |
132 |
Correct |
462 ms |
6972 KB |
Output is correct |
133 |
Correct |
0 ms |
348 KB |
Output is correct |
134 |
Correct |
0 ms |
348 KB |
Output is correct |
135 |
Correct |
1 ms |
604 KB |
Output is correct |
136 |
Correct |
463 ms |
7044 KB |
Output is correct |
137 |
Correct |
1 ms |
348 KB |
Output is correct |
138 |
Correct |
1 ms |
604 KB |
Output is correct |
139 |
Correct |
2 ms |
604 KB |
Output is correct |
140 |
Correct |
1 ms |
348 KB |
Output is correct |
141 |
Correct |
1 ms |
604 KB |
Output is correct |
142 |
Correct |
1 ms |
604 KB |
Output is correct |
143 |
Correct |
1 ms |
348 KB |
Output is correct |
144 |
Correct |
1 ms |
604 KB |
Output is correct |
145 |
Correct |
1 ms |
604 KB |
Output is correct |
146 |
Correct |
0 ms |
348 KB |
Output is correct |
147 |
Correct |
0 ms |
348 KB |
Output is correct |
148 |
Correct |
1 ms |
344 KB |
Output is correct |
149 |
Correct |
0 ms |
348 KB |
Output is correct |
150 |
Correct |
1 ms |
348 KB |
Output is correct |
151 |
Correct |
0 ms |
348 KB |
Output is correct |
152 |
Correct |
0 ms |
344 KB |
Output is correct |
153 |
Correct |
0 ms |
344 KB |
Output is correct |
154 |
Correct |
0 ms |
348 KB |
Output is correct |
155 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Correct |
0 ms |
348 KB |
Output is correct |
162 |
Correct |
0 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 |
860 KB |
Output is correct |
166 |
Correct |
2 ms |
860 KB |
Output is correct |
167 |
Correct |
1 ms |
604 KB |
Output is correct |
168 |
Correct |
1 ms |
604 KB |
Output is correct |
169 |
Correct |
1 ms |
600 KB |
Output is correct |
170 |
Correct |
1 ms |
604 KB |
Output is correct |
171 |
Correct |
1 ms |
604 KB |
Output is correct |
172 |
Correct |
1 ms |
604 KB |
Output is correct |
173 |
Correct |
1 ms |
600 KB |
Output is correct |
174 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
178 |
Correct |
1 ms |
604 KB |
Output is correct |
179 |
Correct |
1 ms |
604 KB |
Output is correct |
180 |
Correct |
1 ms |
604 KB |
Output is correct |
181 |
Correct |
2 ms |
604 KB |
Output is correct |
182 |
Correct |
1 ms |
604 KB |
Output is correct |
183 |
Correct |
1 ms |
604 KB |
Output is correct |
184 |
Correct |
1 ms |
604 KB |
Output is correct |
185 |
Correct |
1 ms |
604 KB |
Output is correct |
186 |
Correct |
1 ms |
604 KB |
Output is correct |
187 |
Correct |
2 ms |
604 KB |
Output is correct |
188 |
Correct |
1 ms |
600 KB |
Output is correct |
189 |
Correct |
2 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 |
600 KB |
Output is correct |
194 |
Correct |
2 ms |
604 KB |
Output is correct |
195 |
Correct |
1 ms |
604 KB |
Output is correct |
196 |
Correct |
1 ms |
604 KB |
Output is correct |
197 |
Correct |
1 ms |
604 KB |
Output is correct |
198 |
Correct |
1 ms |
604 KB |
Output is correct |
199 |
Correct |
1 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 |
604 KB |
Output is correct |
205 |
Correct |
2 ms |
604 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 |
744 KB |
Output is correct |
209 |
Correct |
1 ms |
604 KB |
Output is correct |
210 |
Correct |
1 ms |
604 KB |
Output is correct |
211 |
Correct |
1 ms |
604 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 |
348 KB |
Output is correct |
215 |
Correct |
0 ms |
348 KB |
Output is correct |
216 |
Correct |
0 ms |
348 KB |
Output is correct |
217 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
221 |
Correct |
0 ms |
348 KB |
Output is correct |
222 |
Correct |
0 ms |
356 KB |
Output is correct |
223 |
Correct |
0 ms |
352 KB |
Output is correct |
224 |
Correct |
1 ms |
356 KB |
Output is correct |
225 |
Correct |
1 ms |
356 KB |
Output is correct |
226 |
Correct |
1 ms |
356 KB |
Output is correct |
227 |
Correct |
1 ms |
612 KB |
Output is correct |
228 |
Correct |
1 ms |
612 KB |
Output is correct |
229 |
Incorrect |
82 ms |
10892 KB |
Output isn't correct |
230 |
Halted |
0 ms |
0 KB |
- |