#include "dreaming.h"
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iostream>
#include <cassert>
#include <bitset>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
#pragma optimize("O3")
using namespace std;
// template<typename T>
// using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
// template<typename T, typename S>
// using ordered_map = __gnu_pbds::tree<T, S, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
template<typename T, typename S>
ostream& operator<< (ostream& out, pair<T, S> p) {
return out << "(" << p.first << ", " << p.second << ")";
}
// any ct except std::string
template<typename Container,
typename S = typename enable_if<!is_same<Container, string>::value, typename Container::value_type>::type>
ostream& operator<<(ostream& __out, Container &__ct) {
__out << "{";
bool first = true;
for(auto&& __el : __ct) {
if(!first) __out << ", ";
__out << __el;
first = false;
}
return __out << "}";
}
// bitset
template<size_t N>
ostream& operator<<(ostream& __out, bitset<N> &__bs) {
__out << "{";
for(size_t i = 0; i < N; ++i) __out << (i != 0 ? ", " : "") /*<< boolalpha*/ << __bs[N - i - 1];
return __out << "}";
}
template<typename Tail>
void _dbg(Tail T) {
cerr << T << '\n';
}
template<typename Head, typename... Tail>
void _dbg(Head H, Tail... T) {
cerr << H << ", ";
_dbg(T...);
}
#ifdef DEBUG
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: "; _dbg(__VA_ARGS__);
#else
#define dbg(...) 42
#endif
using vi = vector<int>;
using ii = pair<int, int>;
using vii = vector<ii>;
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
vector<vii> AL(N, vii());
for(int i = 0; i < M; ++i) {
AL[A[i]].emplace_back(B[i], T[i]);
AL[B[i]].emplace_back(A[i], T[i]);
}
vi visited(N, -1);
vi sizes;
sizes.reserve(N);
vi diametri;
diametri.reserve(N);
unordered_map<int, int> dist;
// calcola le distanze dei cc
for(int start = 0; start < N; ++start) {
// non visitato
if(visited[start] == -1) {
// calcola longest path, ricalcolala, prova tutti i nodi in mezzo alla strada piu' lunga
dist.clear();
dist.reserve(N);
visited[start] = true;
// parti da u
queue<int> q;
dist[start] = 0;
q.emplace(start);
while(!q.empty()) {
int u = q.front(); q.pop();
for(auto &[v, w] : AL[u]) {
if(dist.find(v) == dist.end()) {
dist[v] = dist[u] + w; // una sola strada possibile
visited[v] = 1;
q.emplace(v);
}
}
}
int furthest = max_element(dist.begin(), dist.end(), [](const ii &a, const ii &b){
if(a.second == b.second) {
return a.first < b.first;
}
return a.second < b.second;
})->first; // trova l'elemento piu' distante
// rigira la bfs partendo dal piu' distante
dist.clear();
dist.reserve(N);
dist[furthest] = 0;
q.emplace(furthest);
while(!q.empty()) {
int u = q.front(); q.pop();
for(auto &[v, w] : AL[u]) {
if(dist.find(v) == dist.end()) {
dist[v] = dist[u] + w; // una sola strada possibile
q.emplace(v);
}
}
}
int end = max_element(dist.begin(), dist.end(), [](const ii &a, const ii &b){
if(a.second == b.second) {
return a.first < b.first;
}
return a.second < b.second;
})->first; // trova l'elemento piu' distante
int to = end;
// percorri tutti i nodi tra start ed end, trova il migliore
int best = dist[to];
while(furthest != to) {
// avvicinati ad end
dbg(to);
int next = AL[to][0].first;
int next_dist = dist[next];
for(auto &[v, w] : AL[to]) {
if(dist[v] < next_dist) {
next = v;
next_dist = dist[v];
}
}
to = next;
best = min(best, max(dist[to], dist[end] - dist[to]));
}
dbg(to);
diametri.push_back(dist[end]);
sizes.push_back(best);
}
}
if(sizes.size() == 1) {
return diametri[0];
}
else {
nth_element(sizes.begin(), sizes.end()-1-0, sizes.end());
int first = *(sizes.end()-1-0);
nth_element(sizes.begin(), sizes.end()-1-1, sizes.end());
int second = *(sizes.end()-1-1);
int ans = max(
*max_element(diametri.begin(), diametri.end()),
first + L + second
);
if(sizes.size() == 2) return ans;
nth_element(sizes.begin(), sizes.end()-1-2, sizes.end());
int third = *(sizes.end()-1-2);
return max(ans, second + third + 2 * L);
}
}
Compilation message
dreaming.cpp:13: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
13 | #pragma optimize("O3")
|
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:60:18: warning: statement has no effect [-Wunused-value]
60 | #define dbg(...) 42
| ^~
dreaming.cpp:147:17: note: in expansion of macro 'dbg'
147 | dbg(to);
| ^~~
dreaming.cpp:60:18: warning: statement has no effect [-Wunused-value]
60 | #define dbg(...) 42
| ^~
dreaming.cpp:163:13: note: in expansion of macro 'dbg'
163 | dbg(to);
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
10216 KB |
Output is correct |
2 |
Correct |
62 ms |
10204 KB |
Output is correct |
3 |
Correct |
34 ms |
6748 KB |
Output is correct |
4 |
Correct |
7 ms |
1680 KB |
Output is correct |
5 |
Correct |
6 ms |
1228 KB |
Output is correct |
6 |
Correct |
13 ms |
2508 KB |
Output is correct |
7 |
Correct |
1 ms |
452 KB |
Output is correct |
8 |
Correct |
27 ms |
4172 KB |
Output is correct |
9 |
Correct |
33 ms |
5480 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
57 ms |
7212 KB |
Output is correct |
12 |
Correct |
61 ms |
8780 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
0 ms |
204 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
10216 KB |
Output is correct |
2 |
Correct |
62 ms |
10204 KB |
Output is correct |
3 |
Correct |
34 ms |
6748 KB |
Output is correct |
4 |
Correct |
7 ms |
1680 KB |
Output is correct |
5 |
Correct |
6 ms |
1228 KB |
Output is correct |
6 |
Correct |
13 ms |
2508 KB |
Output is correct |
7 |
Correct |
1 ms |
452 KB |
Output is correct |
8 |
Correct |
27 ms |
4172 KB |
Output is correct |
9 |
Correct |
33 ms |
5480 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
57 ms |
7212 KB |
Output is correct |
12 |
Correct |
61 ms |
8780 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
1 ms |
204 KB |
Output is correct |
20 |
Correct |
1 ms |
204 KB |
Output is correct |
21 |
Correct |
1 ms |
204 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
0 ms |
204 KB |
Output is correct |
26 |
Correct |
0 ms |
204 KB |
Output is correct |
27 |
Correct |
0 ms |
204 KB |
Output is correct |
28 |
Correct |
1 ms |
204 KB |
Output is correct |
29 |
Correct |
0 ms |
204 KB |
Output is correct |
30 |
Correct |
0 ms |
204 KB |
Output is correct |
31 |
Correct |
0 ms |
204 KB |
Output is correct |
32 |
Correct |
0 ms |
204 KB |
Output is correct |
33 |
Correct |
0 ms |
204 KB |
Output is correct |
34 |
Correct |
0 ms |
204 KB |
Output is correct |
35 |
Correct |
0 ms |
204 KB |
Output is correct |
36 |
Correct |
0 ms |
204 KB |
Output is correct |
37 |
Correct |
0 ms |
204 KB |
Output is correct |
38 |
Correct |
0 ms |
204 KB |
Output is correct |
39 |
Correct |
55 ms |
10192 KB |
Output is correct |
40 |
Correct |
59 ms |
10272 KB |
Output is correct |
41 |
Correct |
38 ms |
6860 KB |
Output is correct |
42 |
Correct |
11 ms |
1740 KB |
Output is correct |
43 |
Correct |
0 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
0 ms |
204 KB |
Output is correct |
46 |
Correct |
1 ms |
204 KB |
Output is correct |
47 |
Correct |
0 ms |
204 KB |
Output is correct |
48 |
Correct |
0 ms |
204 KB |
Output is correct |
49 |
Correct |
0 ms |
204 KB |
Output is correct |
50 |
Correct |
0 ms |
204 KB |
Output is correct |
51 |
Correct |
0 ms |
204 KB |
Output is correct |
52 |
Correct |
1 ms |
204 KB |
Output is correct |
53 |
Correct |
1 ms |
204 KB |
Output is correct |
54 |
Correct |
0 ms |
204 KB |
Output is correct |
55 |
Correct |
0 ms |
204 KB |
Output is correct |
56 |
Correct |
1 ms |
204 KB |
Output is correct |
57 |
Correct |
81 ms |
11576 KB |
Output is correct |
58 |
Correct |
98 ms |
10284 KB |
Output is correct |
59 |
Correct |
77 ms |
11256 KB |
Output is correct |
60 |
Correct |
72 ms |
10180 KB |
Output is correct |
61 |
Correct |
71 ms |
11412 KB |
Output is correct |
62 |
Correct |
79 ms |
10740 KB |
Output is correct |
63 |
Correct |
81 ms |
11844 KB |
Output is correct |
64 |
Correct |
86 ms |
11900 KB |
Output is correct |
65 |
Correct |
74 ms |
11880 KB |
Output is correct |
66 |
Correct |
80 ms |
11792 KB |
Output is correct |
67 |
Correct |
83 ms |
11344 KB |
Output is correct |
68 |
Correct |
100 ms |
11348 KB |
Output is correct |
69 |
Correct |
88 ms |
10344 KB |
Output is correct |
70 |
Correct |
79 ms |
10332 KB |
Output is correct |
71 |
Correct |
0 ms |
204 KB |
Output is correct |
72 |
Correct |
2 ms |
588 KB |
Output is correct |
73 |
Correct |
2 ms |
588 KB |
Output is correct |
74 |
Correct |
2 ms |
588 KB |
Output is correct |
75 |
Correct |
2 ms |
588 KB |
Output is correct |
76 |
Correct |
2 ms |
588 KB |
Output is correct |
77 |
Correct |
4 ms |
588 KB |
Output is correct |
78 |
Correct |
2 ms |
588 KB |
Output is correct |
79 |
Correct |
3 ms |
588 KB |
Output is correct |
80 |
Correct |
90 ms |
10692 KB |
Output is correct |
81 |
Correct |
83 ms |
10692 KB |
Output is correct |
82 |
Correct |
71 ms |
11404 KB |
Output is correct |
83 |
Correct |
78 ms |
11756 KB |
Output is correct |
84 |
Correct |
1 ms |
460 KB |
Output is correct |
85 |
Correct |
2 ms |
460 KB |
Output is correct |
86 |
Correct |
2 ms |
460 KB |
Output is correct |
87 |
Correct |
2 ms |
460 KB |
Output is correct |
88 |
Correct |
2 ms |
460 KB |
Output is correct |
89 |
Correct |
2 ms |
460 KB |
Output is correct |
90 |
Correct |
2 ms |
572 KB |
Output is correct |
91 |
Correct |
2 ms |
588 KB |
Output is correct |
92 |
Correct |
2 ms |
588 KB |
Output is correct |
93 |
Correct |
2 ms |
588 KB |
Output is correct |
94 |
Correct |
0 ms |
204 KB |
Output is correct |
95 |
Correct |
0 ms |
204 KB |
Output is correct |
96 |
Correct |
1 ms |
204 KB |
Output is correct |
97 |
Correct |
1 ms |
204 KB |
Output is correct |
98 |
Correct |
0 ms |
204 KB |
Output is correct |
99 |
Correct |
0 ms |
204 KB |
Output is correct |
100 |
Correct |
0 ms |
204 KB |
Output is correct |
101 |
Correct |
1 ms |
204 KB |
Output is correct |
102 |
Correct |
0 ms |
204 KB |
Output is correct |
103 |
Correct |
1 ms |
204 KB |
Output is correct |
104 |
Correct |
6 ms |
1228 KB |
Output is correct |
105 |
Correct |
14 ms |
2508 KB |
Output is correct |
106 |
Correct |
0 ms |
332 KB |
Output is correct |
107 |
Correct |
34 ms |
4172 KB |
Output is correct |
108 |
Correct |
38 ms |
5508 KB |
Output is correct |
109 |
Correct |
1 ms |
332 KB |
Output is correct |
110 |
Correct |
52 ms |
7240 KB |
Output is correct |
111 |
Correct |
68 ms |
8776 KB |
Output is correct |
112 |
Correct |
1 ms |
332 KB |
Output is correct |
113 |
Correct |
102 ms |
11212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1086 ms |
6240 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
0 ms |
204 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
0 ms |
204 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
2 ms |
460 KB |
Output is correct |
28 |
Correct |
3 ms |
460 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
2 ms |
460 KB |
Output is correct |
31 |
Correct |
4 ms |
460 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
2 ms |
460 KB |
Output is correct |
34 |
Correct |
3 ms |
460 KB |
Output is correct |
35 |
Correct |
1 ms |
204 KB |
Output is correct |
36 |
Correct |
1 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
204 KB |
Output is correct |
38 |
Correct |
1 ms |
204 KB |
Output is correct |
39 |
Correct |
0 ms |
204 KB |
Output is correct |
40 |
Correct |
0 ms |
204 KB |
Output is correct |
41 |
Correct |
0 ms |
204 KB |
Output is correct |
42 |
Correct |
0 ms |
204 KB |
Output is correct |
43 |
Correct |
0 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
0 ms |
204 KB |
Output is correct |
46 |
Correct |
0 ms |
204 KB |
Output is correct |
47 |
Correct |
1 ms |
204 KB |
Output is correct |
48 |
Correct |
0 ms |
204 KB |
Output is correct |
49 |
Correct |
0 ms |
204 KB |
Output is correct |
50 |
Correct |
0 ms |
204 KB |
Output is correct |
51 |
Correct |
0 ms |
204 KB |
Output is correct |
52 |
Correct |
0 ms |
204 KB |
Output is correct |
53 |
Correct |
0 ms |
204 KB |
Output is correct |
54 |
Correct |
2 ms |
636 KB |
Output is correct |
55 |
Correct |
2 ms |
588 KB |
Output is correct |
56 |
Correct |
6 ms |
460 KB |
Output is correct |
57 |
Correct |
6 ms |
460 KB |
Output is correct |
58 |
Correct |
2 ms |
588 KB |
Output is correct |
59 |
Correct |
2 ms |
588 KB |
Output is correct |
60 |
Correct |
5 ms |
460 KB |
Output is correct |
61 |
Correct |
5 ms |
460 KB |
Output is correct |
62 |
Correct |
2 ms |
588 KB |
Output is correct |
63 |
Correct |
2 ms |
588 KB |
Output is correct |
64 |
Correct |
6 ms |
448 KB |
Output is correct |
65 |
Correct |
4 ms |
516 KB |
Output is correct |
66 |
Correct |
3 ms |
588 KB |
Output is correct |
67 |
Correct |
2 ms |
588 KB |
Output is correct |
68 |
Correct |
4 ms |
524 KB |
Output is correct |
69 |
Correct |
4 ms |
460 KB |
Output is correct |
70 |
Correct |
5 ms |
488 KB |
Output is correct |
71 |
Correct |
5 ms |
460 KB |
Output is correct |
72 |
Correct |
2 ms |
588 KB |
Output is correct |
73 |
Correct |
2 ms |
588 KB |
Output is correct |
74 |
Correct |
2 ms |
460 KB |
Output is correct |
75 |
Correct |
2 ms |
460 KB |
Output is correct |
76 |
Correct |
2 ms |
588 KB |
Output is correct |
77 |
Correct |
2 ms |
588 KB |
Output is correct |
78 |
Correct |
5 ms |
460 KB |
Output is correct |
79 |
Correct |
7 ms |
460 KB |
Output is correct |
80 |
Correct |
9 ms |
332 KB |
Output is correct |
81 |
Correct |
6 ms |
428 KB |
Output is correct |
82 |
Correct |
2 ms |
460 KB |
Output is correct |
83 |
Correct |
2 ms |
460 KB |
Output is correct |
84 |
Correct |
5 ms |
460 KB |
Output is correct |
85 |
Correct |
6 ms |
332 KB |
Output is correct |
86 |
Correct |
4 ms |
460 KB |
Output is correct |
87 |
Correct |
2 ms |
588 KB |
Output is correct |
88 |
Correct |
4 ms |
460 KB |
Output is correct |
89 |
Correct |
5 ms |
460 KB |
Output is correct |
90 |
Correct |
5 ms |
500 KB |
Output is correct |
91 |
Correct |
5 ms |
460 KB |
Output is correct |
92 |
Correct |
2 ms |
460 KB |
Output is correct |
93 |
Correct |
1 ms |
460 KB |
Output is correct |
94 |
Correct |
2 ms |
460 KB |
Output is correct |
95 |
Correct |
2 ms |
460 KB |
Output is correct |
96 |
Correct |
1 ms |
460 KB |
Output is correct |
97 |
Correct |
2 ms |
460 KB |
Output is correct |
98 |
Correct |
3 ms |
460 KB |
Output is correct |
99 |
Correct |
2 ms |
588 KB |
Output is correct |
100 |
Correct |
3 ms |
560 KB |
Output is correct |
101 |
Correct |
1 ms |
588 KB |
Output is correct |
102 |
Correct |
1 ms |
204 KB |
Output is correct |
103 |
Correct |
0 ms |
204 KB |
Output is correct |
104 |
Correct |
1 ms |
204 KB |
Output is correct |
105 |
Correct |
1 ms |
204 KB |
Output is correct |
106 |
Correct |
0 ms |
204 KB |
Output is correct |
107 |
Correct |
0 ms |
204 KB |
Output is correct |
108 |
Correct |
0 ms |
204 KB |
Output is correct |
109 |
Correct |
0 ms |
204 KB |
Output is correct |
110 |
Correct |
0 ms |
204 KB |
Output is correct |
111 |
Correct |
0 ms |
204 KB |
Output is correct |
112 |
Correct |
0 ms |
332 KB |
Output is correct |
113 |
Correct |
1 ms |
332 KB |
Output is correct |
114 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
10216 KB |
Output is correct |
2 |
Correct |
62 ms |
10204 KB |
Output is correct |
3 |
Correct |
34 ms |
6748 KB |
Output is correct |
4 |
Correct |
7 ms |
1680 KB |
Output is correct |
5 |
Correct |
6 ms |
1228 KB |
Output is correct |
6 |
Correct |
13 ms |
2508 KB |
Output is correct |
7 |
Correct |
1 ms |
452 KB |
Output is correct |
8 |
Correct |
27 ms |
4172 KB |
Output is correct |
9 |
Correct |
33 ms |
5480 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
57 ms |
7212 KB |
Output is correct |
12 |
Correct |
61 ms |
8780 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
1 ms |
204 KB |
Output is correct |
20 |
Correct |
1 ms |
204 KB |
Output is correct |
21 |
Correct |
1 ms |
204 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
0 ms |
204 KB |
Output is correct |
25 |
Correct |
0 ms |
204 KB |
Output is correct |
26 |
Correct |
0 ms |
204 KB |
Output is correct |
27 |
Correct |
0 ms |
204 KB |
Output is correct |
28 |
Correct |
1 ms |
204 KB |
Output is correct |
29 |
Correct |
0 ms |
204 KB |
Output is correct |
30 |
Correct |
0 ms |
204 KB |
Output is correct |
31 |
Correct |
0 ms |
204 KB |
Output is correct |
32 |
Correct |
0 ms |
204 KB |
Output is correct |
33 |
Correct |
0 ms |
204 KB |
Output is correct |
34 |
Correct |
0 ms |
204 KB |
Output is correct |
35 |
Correct |
0 ms |
204 KB |
Output is correct |
36 |
Correct |
0 ms |
204 KB |
Output is correct |
37 |
Correct |
0 ms |
204 KB |
Output is correct |
38 |
Correct |
0 ms |
204 KB |
Output is correct |
39 |
Correct |
55 ms |
10192 KB |
Output is correct |
40 |
Correct |
59 ms |
10272 KB |
Output is correct |
41 |
Correct |
38 ms |
6860 KB |
Output is correct |
42 |
Correct |
11 ms |
1740 KB |
Output is correct |
43 |
Correct |
0 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
0 ms |
204 KB |
Output is correct |
46 |
Correct |
1 ms |
204 KB |
Output is correct |
47 |
Correct |
0 ms |
204 KB |
Output is correct |
48 |
Correct |
0 ms |
204 KB |
Output is correct |
49 |
Correct |
0 ms |
204 KB |
Output is correct |
50 |
Correct |
0 ms |
204 KB |
Output is correct |
51 |
Correct |
0 ms |
204 KB |
Output is correct |
52 |
Correct |
1 ms |
204 KB |
Output is correct |
53 |
Correct |
1 ms |
204 KB |
Output is correct |
54 |
Correct |
0 ms |
204 KB |
Output is correct |
55 |
Correct |
0 ms |
204 KB |
Output is correct |
56 |
Correct |
1 ms |
204 KB |
Output is correct |
57 |
Correct |
81 ms |
11576 KB |
Output is correct |
58 |
Correct |
98 ms |
10284 KB |
Output is correct |
59 |
Correct |
77 ms |
11256 KB |
Output is correct |
60 |
Correct |
72 ms |
10180 KB |
Output is correct |
61 |
Correct |
71 ms |
11412 KB |
Output is correct |
62 |
Correct |
79 ms |
10740 KB |
Output is correct |
63 |
Correct |
81 ms |
11844 KB |
Output is correct |
64 |
Correct |
86 ms |
11900 KB |
Output is correct |
65 |
Correct |
74 ms |
11880 KB |
Output is correct |
66 |
Correct |
80 ms |
11792 KB |
Output is correct |
67 |
Correct |
83 ms |
11344 KB |
Output is correct |
68 |
Correct |
100 ms |
11348 KB |
Output is correct |
69 |
Correct |
88 ms |
10344 KB |
Output is correct |
70 |
Correct |
79 ms |
10332 KB |
Output is correct |
71 |
Correct |
0 ms |
204 KB |
Output is correct |
72 |
Correct |
2 ms |
588 KB |
Output is correct |
73 |
Correct |
2 ms |
588 KB |
Output is correct |
74 |
Correct |
2 ms |
588 KB |
Output is correct |
75 |
Correct |
2 ms |
588 KB |
Output is correct |
76 |
Correct |
2 ms |
588 KB |
Output is correct |
77 |
Correct |
4 ms |
588 KB |
Output is correct |
78 |
Correct |
2 ms |
588 KB |
Output is correct |
79 |
Correct |
3 ms |
588 KB |
Output is correct |
80 |
Correct |
90 ms |
10692 KB |
Output is correct |
81 |
Correct |
83 ms |
10692 KB |
Output is correct |
82 |
Correct |
71 ms |
11404 KB |
Output is correct |
83 |
Correct |
78 ms |
11756 KB |
Output is correct |
84 |
Correct |
1 ms |
460 KB |
Output is correct |
85 |
Correct |
2 ms |
460 KB |
Output is correct |
86 |
Correct |
2 ms |
460 KB |
Output is correct |
87 |
Correct |
2 ms |
460 KB |
Output is correct |
88 |
Correct |
2 ms |
460 KB |
Output is correct |
89 |
Correct |
2 ms |
460 KB |
Output is correct |
90 |
Correct |
2 ms |
572 KB |
Output is correct |
91 |
Correct |
2 ms |
588 KB |
Output is correct |
92 |
Correct |
2 ms |
588 KB |
Output is correct |
93 |
Correct |
2 ms |
588 KB |
Output is correct |
94 |
Correct |
0 ms |
204 KB |
Output is correct |
95 |
Correct |
0 ms |
204 KB |
Output is correct |
96 |
Correct |
1 ms |
204 KB |
Output is correct |
97 |
Correct |
1 ms |
204 KB |
Output is correct |
98 |
Correct |
0 ms |
204 KB |
Output is correct |
99 |
Correct |
0 ms |
204 KB |
Output is correct |
100 |
Correct |
0 ms |
204 KB |
Output is correct |
101 |
Correct |
1 ms |
204 KB |
Output is correct |
102 |
Correct |
0 ms |
204 KB |
Output is correct |
103 |
Correct |
1 ms |
204 KB |
Output is correct |
104 |
Correct |
6 ms |
1228 KB |
Output is correct |
105 |
Correct |
14 ms |
2508 KB |
Output is correct |
106 |
Correct |
0 ms |
332 KB |
Output is correct |
107 |
Correct |
34 ms |
4172 KB |
Output is correct |
108 |
Correct |
38 ms |
5508 KB |
Output is correct |
109 |
Correct |
1 ms |
332 KB |
Output is correct |
110 |
Correct |
52 ms |
7240 KB |
Output is correct |
111 |
Correct |
68 ms |
8776 KB |
Output is correct |
112 |
Correct |
1 ms |
332 KB |
Output is correct |
113 |
Correct |
102 ms |
11212 KB |
Output is correct |
114 |
Execution timed out |
1086 ms |
6240 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |