#include"dreaming.h"
#include <bits/stdc++.h>
using namespace std;
struct edge
{
int u, w;
};
struct tpos
{
int nodo, dist, padre;
};
int max_tam;
vector<vector<edge>> adj;
pair<int, int> bfs (int nodo, int N)
{
// cout << "nodo: " << nodo << '\n';
pair<int, int> ret;
ret.second = -1;
queue<tpos> q;
q.push({nodo, 0, -1});
tpos temp_tpos;
vector<bool> visi(N);
while (!q.empty())
{
temp_tpos = q.front(); q.pop();
visi[temp_tpos.nodo] = 1;
//cout << " " << temp_tpos.nodo << " " << temp_tpos.dist << "\n";
for (edge e: adj[temp_tpos.nodo])
{
// cout << temp_tpos.nodo << " vecinos: " << e.u << '\n';
if (visi[e.u]) continue;
q.push({e.u, temp_tpos.dist+e.w, temp_tpos.nodo});
}
if (temp_tpos.dist > ret.second)
{
ret.second = temp_tpos.dist;
ret.first = temp_tpos.nodo;
}
}
//cout << '\n';
return ret;
}
int Diametro (int N)
{
int ve = bfs(0, N).first;
return bfs(ve, N).second;
}
struct dsu
{
struct componente
{
int representante;
int inicio_diametro, fin_diametro;
int punto_medio, distancia_punto_medio;
vector <int> miembros;
int diametro;
map<int, int> distancia_diametro1, distancia_diametro2;
void BFS (int nodo)
{
queue<tpos> q;
q.push({nodo, 0, -1});
vector<bool> visi(max_tam);
tpos temp_tpos;
while (!q.empty())
{
temp_tpos = q.front(); q.pop();
visi[temp_tpos.nodo] = 1;
distancia_diametro2[temp_tpos.nodo] = temp_tpos.dist;
for (edge e: adj[temp_tpos.nodo])
{
if (visi[e.u]) continue;
q.push({e.u, temp_tpos.dist+e.w, temp_tpos.nodo});
}
}
}
pair<int, int> other_bfs (int nodo, bool pasada)
{
pair<int, int> ret;
ret.second = -1;
queue<tpos> q;
q.push({nodo, 0, -1});
vector<bool> visi(max_tam);
tpos temp_tpos;
while (!q.empty())
{
temp_tpos = q.front(); q.pop();
visi[temp_tpos.nodo] = 1;
if (pasada)
distancia_diametro1[temp_tpos.nodo] = temp_tpos.dist;
for (edge e: adj[temp_tpos.nodo])
{
if (visi[e.u]) continue;
q.push({e.u, temp_tpos.dist+e.w, temp_tpos.nodo});
}
if (temp_tpos.dist > ret.second)
{
ret.second = temp_tpos.dist;
ret.first = temp_tpos.nodo;
}
}
return ret;
}
void get_punto_medio ()
{
int mini = 1<<30;
BFS(fin_diametro);
for (int i = 0; i < miembros.size(); i++)
{
int temp_dist = distancia_diametro1[miembros[i]];
// cout << miembros[i] << " -> " << temp_dist << '\n';
int temp_longlong = max(temp_dist, distancia_diametro2[miembros[i]]);
if (mini > temp_longlong)
{
mini = temp_longlong;
punto_medio = miembros[i];
}
distancia_punto_medio = mini;
}
}
void get_diametro()
{
int resp = other_bfs(representante, 0).first;
inicio_diametro = resp;
pair<int, int> temp_pair = other_bfs(resp, 1);
fin_diametro = temp_pair.first;
diametro = temp_pair.second;
// cout << representante << ": \n";
get_punto_medio();
}
};
int N;
vector<int>parent;
vector<componente> arboles;
vector<vector<int>> miembros_de_componente;
dsu(int n)
{
parent.resize(n);
N = n;
miembros_de_componente.resize(n);
for (int i = 0; i < N; i++)
parent[i] = i;
}
void une (int a, int b)
{
parent[busca(a)] = busca(b);
}
int busca (int a)
{
if (parent[a] == a) return a;
return (parent[a] = busca(parent[a]));
}
void crea_componentes()
{
for (int i = 0; i < N; i++)
miembros_de_componente[busca(i)].push_back(i);
for (int i = 0; i < N; i++)
{
if (miembros_de_componente[i].empty()) continue;
componente comp_temp;
comp_temp.representante = i;
comp_temp.miembros = miembros_de_componente[i];
arboles.push_back(comp_temp);
arboles.back().get_diametro();
//cout << '\n';
}
}
};
struct componente_condensada
{
int diametro, distancia_punto_medio;
};
bool operator < (const componente_condensada &a, componente_condensada &b)
{
if (a.diametro == b.diametro) return a.distancia_punto_medio < b.distancia_punto_medio;
return a.diametro < b.diametro;
}
int travelTime(int N, int M, int L, int A[], int B[], int T[])
{
// cout << '\n';
max_tam = N;
adj.resize(N);
edge temp_edge;
dsu bosque(N);
for (int i = 0; i < M; i++)
{
temp_edge.u = B[i];
temp_edge.w = T[i];
adj[A[i]].push_back(temp_edge);
temp_edge.u = A[i];
adj[B[i]].push_back(temp_edge);
bosque.une(A[i], B[i]);
}
bosque.crea_componentes();
int temp_mid_pnt;
int cnt = 1;
priority_queue<pair<int, int>> pq;
for (dsu::componente comp: bosque.arboles)
pq.push({comp.diametro, comp.distancia_punto_medio});
while (pq.size() > 1)
{
pair<int, int> a1 = pq.top(); pq.pop();
pair<int, int> a2 = pq.top(); pq.pop();
pair<int, int> temporal;
temporal.first = max(a1.first, max(a2.first, a1.second + a2.second + L));
temporal.second = min (max (a1.second + L, a2.second), max(a2.second + L, a1.second));
pq.push(temporal);
}
return pq.top().first;
return 1;
}
Compilation message
dreaming.cpp: In member function 'void dsu::componente::get_punto_medio()':
dreaming.cpp:111:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
111 | for (int i = 0; i < miembros.size(); i++)
| ~~^~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:206:9: warning: unused variable 'temp_mid_pnt' [-Wunused-variable]
206 | int temp_mid_pnt;
| ^~~~~~~~~~~~
dreaming.cpp:207:9: warning: unused variable 'cnt' [-Wunused-variable]
207 | int cnt = 1;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
122 ms |
27496 KB |
Output is correct |
2 |
Correct |
136 ms |
27752 KB |
Output is correct |
3 |
Correct |
71 ms |
18144 KB |
Output is correct |
4 |
Correct |
14 ms |
4444 KB |
Output is correct |
5 |
Correct |
10 ms |
2904 KB |
Output is correct |
6 |
Correct |
22 ms |
6232 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
46 ms |
10656 KB |
Output is correct |
9 |
Correct |
59 ms |
13936 KB |
Output is correct |
10 |
Correct |
1 ms |
756 KB |
Output is correct |
11 |
Correct |
91 ms |
18668 KB |
Output is correct |
12 |
Correct |
115 ms |
22652 KB |
Output is correct |
13 |
Correct |
1 ms |
600 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 |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
122 ms |
27496 KB |
Output is correct |
2 |
Correct |
136 ms |
27752 KB |
Output is correct |
3 |
Correct |
71 ms |
18144 KB |
Output is correct |
4 |
Correct |
14 ms |
4444 KB |
Output is correct |
5 |
Correct |
10 ms |
2904 KB |
Output is correct |
6 |
Correct |
22 ms |
6232 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
46 ms |
10656 KB |
Output is correct |
9 |
Correct |
59 ms |
13936 KB |
Output is correct |
10 |
Correct |
1 ms |
756 KB |
Output is correct |
11 |
Correct |
91 ms |
18668 KB |
Output is correct |
12 |
Correct |
115 ms |
22652 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
126 ms |
27888 KB |
Output is correct |
40 |
Correct |
126 ms |
27384 KB |
Output is correct |
41 |
Correct |
73 ms |
18160 KB |
Output is correct |
42 |
Correct |
14 ms |
4440 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
344 KB |
Output is correct |
47 |
Correct |
1 ms |
344 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
600 KB |
Output is correct |
50 |
Correct |
1 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
344 KB |
Output is correct |
52 |
Correct |
0 ms |
344 KB |
Output is correct |
53 |
Correct |
1 ms |
600 KB |
Output is correct |
54 |
Correct |
1 ms |
344 KB |
Output is correct |
55 |
Correct |
1 ms |
344 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
147 ms |
30040 KB |
Output is correct |
58 |
Correct |
159 ms |
26184 KB |
Output is correct |
59 |
Correct |
148 ms |
29132 KB |
Output is correct |
60 |
Correct |
137 ms |
25592 KB |
Output is correct |
61 |
Correct |
154 ms |
29244 KB |
Output is correct |
62 |
Correct |
156 ms |
27128 KB |
Output is correct |
63 |
Correct |
155 ms |
30284 KB |
Output is correct |
64 |
Correct |
159 ms |
30244 KB |
Output is correct |
65 |
Correct |
173 ms |
30184 KB |
Output is correct |
66 |
Correct |
166 ms |
30220 KB |
Output is correct |
67 |
Correct |
153 ms |
29404 KB |
Output is correct |
68 |
Correct |
146 ms |
29040 KB |
Output is correct |
69 |
Correct |
141 ms |
26304 KB |
Output is correct |
70 |
Correct |
148 ms |
26344 KB |
Output is correct |
71 |
Correct |
1 ms |
344 KB |
Output is correct |
72 |
Correct |
3 ms |
1112 KB |
Output is correct |
73 |
Correct |
4 ms |
1112 KB |
Output is correct |
74 |
Correct |
3 ms |
1112 KB |
Output is correct |
75 |
Correct |
3 ms |
1112 KB |
Output is correct |
76 |
Correct |
3 ms |
1112 KB |
Output is correct |
77 |
Correct |
3 ms |
1112 KB |
Output is correct |
78 |
Correct |
3 ms |
1112 KB |
Output is correct |
79 |
Correct |
3 ms |
1368 KB |
Output is correct |
80 |
Correct |
149 ms |
27260 KB |
Output is correct |
81 |
Correct |
139 ms |
27320 KB |
Output is correct |
82 |
Correct |
144 ms |
29008 KB |
Output is correct |
83 |
Correct |
157 ms |
30024 KB |
Output is correct |
84 |
Correct |
2 ms |
856 KB |
Output is correct |
85 |
Correct |
3 ms |
856 KB |
Output is correct |
86 |
Correct |
3 ms |
856 KB |
Output is correct |
87 |
Correct |
3 ms |
856 KB |
Output is correct |
88 |
Correct |
3 ms |
1116 KB |
Output is correct |
89 |
Correct |
3 ms |
856 KB |
Output is correct |
90 |
Correct |
3 ms |
1112 KB |
Output is correct |
91 |
Correct |
3 ms |
1112 KB |
Output is correct |
92 |
Correct |
3 ms |
1116 KB |
Output is correct |
93 |
Correct |
3 ms |
1112 KB |
Output is correct |
94 |
Correct |
1 ms |
344 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
1 ms |
344 KB |
Output is correct |
97 |
Correct |
1 ms |
500 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 |
344 KB |
Output is correct |
101 |
Correct |
0 ms |
344 KB |
Output is correct |
102 |
Correct |
0 ms |
344 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Correct |
10 ms |
2904 KB |
Output is correct |
105 |
Correct |
22 ms |
6232 KB |
Output is correct |
106 |
Correct |
1 ms |
344 KB |
Output is correct |
107 |
Correct |
45 ms |
10576 KB |
Output is correct |
108 |
Correct |
62 ms |
13936 KB |
Output is correct |
109 |
Correct |
1 ms |
600 KB |
Output is correct |
110 |
Correct |
94 ms |
18688 KB |
Output is correct |
111 |
Correct |
132 ms |
22812 KB |
Output is correct |
112 |
Correct |
1 ms |
604 KB |
Output is correct |
113 |
Correct |
149 ms |
29552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
110 ms |
30408 KB |
Output is correct |
2 |
Correct |
116 ms |
30548 KB |
Output is correct |
3 |
Correct |
111 ms |
30568 KB |
Output is correct |
4 |
Correct |
122 ms |
30668 KB |
Output is correct |
5 |
Correct |
113 ms |
30408 KB |
Output is correct |
6 |
Correct |
127 ms |
42696 KB |
Output is correct |
7 |
Correct |
128 ms |
31692 KB |
Output is correct |
8 |
Correct |
113 ms |
30224 KB |
Output is correct |
9 |
Correct |
114 ms |
29640 KB |
Output is correct |
10 |
Correct |
122 ms |
31436 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
131 ms |
38628 KB |
Output is correct |
13 |
Correct |
127 ms |
39616 KB |
Output is correct |
14 |
Correct |
142 ms |
38652 KB |
Output is correct |
15 |
Correct |
132 ms |
39412 KB |
Output is correct |
16 |
Correct |
139 ms |
38584 KB |
Output is correct |
17 |
Correct |
133 ms |
38588 KB |
Output is correct |
18 |
Correct |
130 ms |
39580 KB |
Output is correct |
19 |
Correct |
139 ms |
37832 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
3 ms |
1472 KB |
Output is correct |
23 |
Correct |
132 ms |
39428 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 |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
604 KB |
Output is correct |
27 |
Correct |
2 ms |
860 KB |
Output is correct |
28 |
Correct |
3 ms |
1112 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
2 ms |
860 KB |
Output is correct |
31 |
Correct |
3 ms |
1112 KB |
Output is correct |
32 |
Correct |
1 ms |
604 KB |
Output is correct |
33 |
Correct |
2 ms |
860 KB |
Output is correct |
34 |
Correct |
4 ms |
1116 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
344 KB |
Output is correct |
40 |
Correct |
1 ms |
600 KB |
Output is correct |
41 |
Correct |
0 ms |
344 KB |
Output is correct |
42 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
344 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
344 KB |
Output is correct |
51 |
Correct |
1 ms |
344 KB |
Output is correct |
52 |
Correct |
1 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
3 ms |
1116 KB |
Output is correct |
55 |
Correct |
3 ms |
1112 KB |
Output is correct |
56 |
Correct |
3 ms |
1216 KB |
Output is correct |
57 |
Correct |
4 ms |
1468 KB |
Output is correct |
58 |
Correct |
4 ms |
1116 KB |
Output is correct |
59 |
Correct |
4 ms |
1112 KB |
Output is correct |
60 |
Correct |
3 ms |
1216 KB |
Output is correct |
61 |
Correct |
3 ms |
1472 KB |
Output is correct |
62 |
Correct |
4 ms |
1112 KB |
Output is correct |
63 |
Correct |
4 ms |
1116 KB |
Output is correct |
64 |
Incorrect |
3 ms |
1472 KB |
Output isn't correct |
65 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
122 ms |
27496 KB |
Output is correct |
2 |
Correct |
136 ms |
27752 KB |
Output is correct |
3 |
Correct |
71 ms |
18144 KB |
Output is correct |
4 |
Correct |
14 ms |
4444 KB |
Output is correct |
5 |
Correct |
10 ms |
2904 KB |
Output is correct |
6 |
Correct |
22 ms |
6232 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
46 ms |
10656 KB |
Output is correct |
9 |
Correct |
59 ms |
13936 KB |
Output is correct |
10 |
Correct |
1 ms |
756 KB |
Output is correct |
11 |
Correct |
91 ms |
18668 KB |
Output is correct |
12 |
Correct |
115 ms |
22652 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
126 ms |
27888 KB |
Output is correct |
40 |
Correct |
126 ms |
27384 KB |
Output is correct |
41 |
Correct |
73 ms |
18160 KB |
Output is correct |
42 |
Correct |
14 ms |
4440 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
344 KB |
Output is correct |
47 |
Correct |
1 ms |
344 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
600 KB |
Output is correct |
50 |
Correct |
1 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
344 KB |
Output is correct |
52 |
Correct |
0 ms |
344 KB |
Output is correct |
53 |
Correct |
1 ms |
600 KB |
Output is correct |
54 |
Correct |
1 ms |
344 KB |
Output is correct |
55 |
Correct |
1 ms |
344 KB |
Output is correct |
56 |
Correct |
1 ms |
344 KB |
Output is correct |
57 |
Correct |
147 ms |
30040 KB |
Output is correct |
58 |
Correct |
159 ms |
26184 KB |
Output is correct |
59 |
Correct |
148 ms |
29132 KB |
Output is correct |
60 |
Correct |
137 ms |
25592 KB |
Output is correct |
61 |
Correct |
154 ms |
29244 KB |
Output is correct |
62 |
Correct |
156 ms |
27128 KB |
Output is correct |
63 |
Correct |
155 ms |
30284 KB |
Output is correct |
64 |
Correct |
159 ms |
30244 KB |
Output is correct |
65 |
Correct |
173 ms |
30184 KB |
Output is correct |
66 |
Correct |
166 ms |
30220 KB |
Output is correct |
67 |
Correct |
153 ms |
29404 KB |
Output is correct |
68 |
Correct |
146 ms |
29040 KB |
Output is correct |
69 |
Correct |
141 ms |
26304 KB |
Output is correct |
70 |
Correct |
148 ms |
26344 KB |
Output is correct |
71 |
Correct |
1 ms |
344 KB |
Output is correct |
72 |
Correct |
3 ms |
1112 KB |
Output is correct |
73 |
Correct |
4 ms |
1112 KB |
Output is correct |
74 |
Correct |
3 ms |
1112 KB |
Output is correct |
75 |
Correct |
3 ms |
1112 KB |
Output is correct |
76 |
Correct |
3 ms |
1112 KB |
Output is correct |
77 |
Correct |
3 ms |
1112 KB |
Output is correct |
78 |
Correct |
3 ms |
1112 KB |
Output is correct |
79 |
Correct |
3 ms |
1368 KB |
Output is correct |
80 |
Correct |
149 ms |
27260 KB |
Output is correct |
81 |
Correct |
139 ms |
27320 KB |
Output is correct |
82 |
Correct |
144 ms |
29008 KB |
Output is correct |
83 |
Correct |
157 ms |
30024 KB |
Output is correct |
84 |
Correct |
2 ms |
856 KB |
Output is correct |
85 |
Correct |
3 ms |
856 KB |
Output is correct |
86 |
Correct |
3 ms |
856 KB |
Output is correct |
87 |
Correct |
3 ms |
856 KB |
Output is correct |
88 |
Correct |
3 ms |
1116 KB |
Output is correct |
89 |
Correct |
3 ms |
856 KB |
Output is correct |
90 |
Correct |
3 ms |
1112 KB |
Output is correct |
91 |
Correct |
3 ms |
1112 KB |
Output is correct |
92 |
Correct |
3 ms |
1116 KB |
Output is correct |
93 |
Correct |
3 ms |
1112 KB |
Output is correct |
94 |
Correct |
1 ms |
344 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
1 ms |
344 KB |
Output is correct |
97 |
Correct |
1 ms |
500 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 |
344 KB |
Output is correct |
101 |
Correct |
0 ms |
344 KB |
Output is correct |
102 |
Correct |
0 ms |
344 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Correct |
10 ms |
2904 KB |
Output is correct |
105 |
Correct |
22 ms |
6232 KB |
Output is correct |
106 |
Correct |
1 ms |
344 KB |
Output is correct |
107 |
Correct |
45 ms |
10576 KB |
Output is correct |
108 |
Correct |
62 ms |
13936 KB |
Output is correct |
109 |
Correct |
1 ms |
600 KB |
Output is correct |
110 |
Correct |
94 ms |
18688 KB |
Output is correct |
111 |
Correct |
132 ms |
22812 KB |
Output is correct |
112 |
Correct |
1 ms |
604 KB |
Output is correct |
113 |
Correct |
149 ms |
29552 KB |
Output is correct |
114 |
Correct |
110 ms |
30408 KB |
Output is correct |
115 |
Correct |
116 ms |
30548 KB |
Output is correct |
116 |
Correct |
111 ms |
30568 KB |
Output is correct |
117 |
Correct |
122 ms |
30668 KB |
Output is correct |
118 |
Correct |
113 ms |
30408 KB |
Output is correct |
119 |
Correct |
127 ms |
42696 KB |
Output is correct |
120 |
Correct |
128 ms |
31692 KB |
Output is correct |
121 |
Correct |
113 ms |
30224 KB |
Output is correct |
122 |
Correct |
114 ms |
29640 KB |
Output is correct |
123 |
Correct |
122 ms |
31436 KB |
Output is correct |
124 |
Correct |
1 ms |
348 KB |
Output is correct |
125 |
Correct |
131 ms |
38628 KB |
Output is correct |
126 |
Correct |
127 ms |
39616 KB |
Output is correct |
127 |
Correct |
142 ms |
38652 KB |
Output is correct |
128 |
Correct |
132 ms |
39412 KB |
Output is correct |
129 |
Correct |
139 ms |
38584 KB |
Output is correct |
130 |
Correct |
133 ms |
38588 KB |
Output is correct |
131 |
Correct |
130 ms |
39580 KB |
Output is correct |
132 |
Correct |
139 ms |
37832 KB |
Output is correct |
133 |
Correct |
0 ms |
348 KB |
Output is correct |
134 |
Correct |
1 ms |
344 KB |
Output is correct |
135 |
Correct |
3 ms |
1472 KB |
Output is correct |
136 |
Correct |
132 ms |
39428 KB |
Output is correct |
137 |
Correct |
1 ms |
604 KB |
Output is correct |
138 |
Correct |
2 ms |
860 KB |
Output is correct |
139 |
Correct |
3 ms |
1112 KB |
Output is correct |
140 |
Correct |
2 ms |
604 KB |
Output is correct |
141 |
Correct |
2 ms |
860 KB |
Output is correct |
142 |
Correct |
3 ms |
1112 KB |
Output is correct |
143 |
Correct |
1 ms |
604 KB |
Output is correct |
144 |
Correct |
2 ms |
860 KB |
Output is correct |
145 |
Correct |
4 ms |
1116 KB |
Output is correct |
146 |
Correct |
1 ms |
344 KB |
Output is correct |
147 |
Correct |
1 ms |
348 KB |
Output is correct |
148 |
Correct |
0 ms |
344 KB |
Output is correct |
149 |
Correct |
1 ms |
344 KB |
Output is correct |
150 |
Correct |
0 ms |
344 KB |
Output is correct |
151 |
Correct |
1 ms |
600 KB |
Output is correct |
152 |
Correct |
0 ms |
344 KB |
Output is correct |
153 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
158 |
Correct |
1 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
344 KB |
Output is correct |
160 |
Correct |
1 ms |
348 KB |
Output is correct |
161 |
Correct |
1 ms |
344 KB |
Output is correct |
162 |
Correct |
1 ms |
344 KB |
Output is correct |
163 |
Correct |
1 ms |
348 KB |
Output is correct |
164 |
Correct |
0 ms |
344 KB |
Output is correct |
165 |
Correct |
3 ms |
1116 KB |
Output is correct |
166 |
Correct |
3 ms |
1112 KB |
Output is correct |
167 |
Correct |
3 ms |
1216 KB |
Output is correct |
168 |
Correct |
4 ms |
1468 KB |
Output is correct |
169 |
Correct |
4 ms |
1116 KB |
Output is correct |
170 |
Correct |
4 ms |
1112 KB |
Output is correct |
171 |
Correct |
3 ms |
1216 KB |
Output is correct |
172 |
Correct |
3 ms |
1472 KB |
Output is correct |
173 |
Correct |
4 ms |
1112 KB |
Output is correct |
174 |
Correct |
4 ms |
1116 KB |
Output is correct |
175 |
Incorrect |
3 ms |
1472 KB |
Output isn't correct |
176 |
Halted |
0 ms |
0 KB |
- |