#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using pll = pair<ll, ll>;
template <class T>
using vec = vector<T>;
template <class T>
using indexed_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define FOR(i, s, e) for (ll i = (ll)s; i < e; i++)
#define CFOR(i, s, e) for (ll i = (ll)s; i <= e; i++)
#define TRAV(e, a) for (const auto &e : a)
#define all(x) x.begin(), x.end()
#define dbg(x) cerr << "ln" << __LINE__ << ": " << #x << " = " << x << endl;
template <class T, class = decay_t<decltype(*begin(declval<T>()))>,
class = enable_if_t<!is_same<T, string>::value>>
ostream &operator<<(ostream &out, const T &obj) {
out << "[";
for (auto it = obj.begin(); it != obj.end(); it++) {
out << &", "[2 * (it == obj.begin())] << *it;
}
return out << "]";
}
template <class K, class V>
ostream &operator<<(ostream &out, const pair<K, V> &obj) {
return out << "(" << obj.first << ", " << obj.second << ")";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n, m;
cin >> n >> m;
vec<vec<ll>> graph(n + 1);
FOR(i, 0, m) {
ll a, b;
cin >> a >> b;
graph[a].push_back(b);
graph[b].push_back(a);
}
ll ans = 0;
vec<ll> tin(n + 1), low(n + 1), visited(n + 1), is_cut(n + 1);
ll tm = 0;
CFOR(root, 1, n) {
vec<pll> comp;
vec<ll> arti;
vec<vec<ll>> blocks;
function<void(ll, ll)> dfs1 = [&](ll curr, ll prev) {
low[curr] = tin[curr] = tm++;
visited[curr] = 1;
ll ch = 0;
TRAV(e, graph[curr]) {
if (e == prev) continue;
if (visited[e]) {
low[curr] = min(low[curr], tin[e]);
if (tin[e] < tin[curr]) comp.push_back({curr, e});
} else {
comp.push_back({curr, e});
dfs1(e, curr);
low[curr] = min(low[curr], low[e]);
ch++;
if (tin[curr] <= low[e] && curr != root) {
arti.push_back(curr);
is_cut[curr] = 1;
}
if (tin[curr] <= low[e] || curr == root) {
blocks.push_back({});
vec<ll> &obj = blocks.back();
while (comp.back() != pll{curr, e}) {
obj.push_back(comp.back().first);
obj.push_back(comp.back().second);
comp.pop_back();
}
obj.push_back(comp.back().first);
obj.push_back(comp.back().second);
comp.pop_back();
sort(all(obj));
obj.erase(unique(all(obj)), obj.end());
}
}
}
if (curr == root && ch > 1) {
arti.push_back(curr);
is_cut[curr] = 1;
}
};
if (visited[root]) continue;
dfs1(root, 0);
sort(all(arti));
arti.erase(unique(all(arti)), arti.end());
ll gsize = arti.size() + blocks.size();
if (gsize == 0) continue;
vec<vec<ll>> cgraph(gsize);
vec<ll> nn(gsize);
FOR(i, 0, blocks.size()) {
TRAV(e, blocks[i]) {
if (!is_cut[e]) continue;
ll cnode = lower_bound(all(arti), e) - arti.begin();
cgraph[cnode].push_back(arti.size() + i);
cgraph[arti.size() + i].push_back(cnode);
}
nn[arti.size() + i] = blocks[i].size();
}
// dbg(arti);
// dbg(blocks);
// dbg(cgraph);
// dbg(nn);
vec<ll> ssize(gsize);
function<void(ll, ll)> dfs2 = [&](ll curr, ll prev) {
ssize[curr] = max(0ll, nn[curr] - 1);
TRAV(e, cgraph[curr]) {
if (e == prev) continue;
dfs2(e, curr);
ssize[curr] += ssize[e];
}
};
dfs2(gsize - 1, -1);
ll tsize = ssize[gsize - 1] + 1;
// dbg(ssize);
function<void(ll, ll)> dfs3 = [&](ll curr, ll prev) {
ll psize = tsize - nn[curr];
vec<ll> bs;
TRAV(e, cgraph[curr]) {
if (e == prev) continue;
dfs3(e, curr);
bs.push_back(ssize[e]);
psize -= ssize[e];
}
if (nn[curr]) {
if (psize) bs.push_back(psize);
ans += nn[curr] * (nn[curr] - 1) * (nn[curr] - 2);
ll sm = accumulate(all(bs), 0ll);
TRAV(e, bs) ans += e * (sm - e) * nn[curr];
TRAV(e, bs) {
ans += 2 * (nn[curr] - 1) * e;
ans += 2 * (nn[curr] - 1) * (nn[curr] - 2) * e;
}
} else {
assert(psize > 1);
bs.push_back(psize - 1);
ll sm = accumulate(all(bs), 0ll);
TRAV(e, bs) ans -= e * (sm - e);
}
};
dfs3(gsize - 1, -1);
}
cout << ans << "\n";
}
Compilation message
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:17:43: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<std::vector<long long int, std::allocator<long long int> >, std::allocator<std::vector<long long int, std::allocator<long long int> > > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
17 | #define FOR(i, s, e) for (ll i = (ll)s; i < e; i++)
......
106 | FOR(i, 0, blocks.size()) {
| ~~~~~~~~~~~~~~~~~~~
count_triplets.cpp:106:9: note: in expansion of macro 'FOR'
106 | FOR(i, 0, blocks.size()) {
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
456 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
456 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
1 ms |
348 KB |
Output is correct |
60 |
Correct |
1 ms |
348 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
456 KB |
Output is correct |
65 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
27796 KB |
Output is correct |
2 |
Correct |
75 ms |
27780 KB |
Output is correct |
3 |
Correct |
134 ms |
31428 KB |
Output is correct |
4 |
Correct |
84 ms |
25504 KB |
Output is correct |
5 |
Correct |
108 ms |
24016 KB |
Output is correct |
6 |
Correct |
128 ms |
30028 KB |
Output is correct |
7 |
Correct |
103 ms |
19296 KB |
Output is correct |
8 |
Correct |
110 ms |
22972 KB |
Output is correct |
9 |
Correct |
103 ms |
14304 KB |
Output is correct |
10 |
Correct |
111 ms |
16460 KB |
Output is correct |
11 |
Correct |
48 ms |
9052 KB |
Output is correct |
12 |
Correct |
50 ms |
9976 KB |
Output is correct |
13 |
Correct |
47 ms |
9808 KB |
Output is correct |
14 |
Correct |
42 ms |
9640 KB |
Output is correct |
15 |
Correct |
33 ms |
9052 KB |
Output is correct |
16 |
Correct |
34 ms |
9048 KB |
Output is correct |
17 |
Correct |
6 ms |
5720 KB |
Output is correct |
18 |
Correct |
6 ms |
5724 KB |
Output is correct |
19 |
Correct |
6 ms |
5720 KB |
Output is correct |
20 |
Correct |
6 ms |
5724 KB |
Output is correct |
21 |
Correct |
6 ms |
5724 KB |
Output is correct |
22 |
Correct |
6 ms |
5964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Correct |
1 ms |
576 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
2 ms |
856 KB |
Output is correct |
5 |
Correct |
2 ms |
860 KB |
Output is correct |
6 |
Correct |
2 ms |
856 KB |
Output is correct |
7 |
Correct |
1 ms |
860 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
856 KB |
Output is correct |
11 |
Correct |
2 ms |
604 KB |
Output is correct |
12 |
Correct |
2 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
2 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
106 ms |
27512 KB |
Output is correct |
2 |
Correct |
109 ms |
27508 KB |
Output is correct |
3 |
Correct |
106 ms |
27660 KB |
Output is correct |
4 |
Correct |
112 ms |
27248 KB |
Output is correct |
5 |
Correct |
134 ms |
27684 KB |
Output is correct |
6 |
Correct |
167 ms |
45948 KB |
Output is correct |
7 |
Correct |
148 ms |
39484 KB |
Output is correct |
8 |
Correct |
141 ms |
36716 KB |
Output is correct |
9 |
Correct |
131 ms |
33536 KB |
Output is correct |
10 |
Correct |
103 ms |
19584 KB |
Output is correct |
11 |
Correct |
122 ms |
24952 KB |
Output is correct |
12 |
Correct |
102 ms |
15140 KB |
Output is correct |
13 |
Correct |
104 ms |
14152 KB |
Output is correct |
14 |
Correct |
76 ms |
9296 KB |
Output is correct |
15 |
Correct |
58 ms |
10276 KB |
Output is correct |
16 |
Correct |
37 ms |
8796 KB |
Output is correct |
17 |
Correct |
54 ms |
26812 KB |
Output is correct |
18 |
Correct |
57 ms |
26288 KB |
Output is correct |
19 |
Correct |
56 ms |
26924 KB |
Output is correct |
20 |
Correct |
55 ms |
26048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
2 ms |
856 KB |
Output is correct |
13 |
Correct |
2 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
604 KB |
Output is correct |
22 |
Correct |
1 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
1 ms |
604 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
120 ms |
27696 KB |
Output is correct |
2 |
Correct |
118 ms |
27652 KB |
Output is correct |
3 |
Correct |
116 ms |
26080 KB |
Output is correct |
4 |
Correct |
98 ms |
22380 KB |
Output is correct |
5 |
Correct |
77 ms |
17864 KB |
Output is correct |
6 |
Correct |
68 ms |
16008 KB |
Output is correct |
7 |
Correct |
59 ms |
14984 KB |
Output is correct |
8 |
Correct |
55 ms |
13968 KB |
Output is correct |
9 |
Correct |
49 ms |
13200 KB |
Output is correct |
10 |
Correct |
56 ms |
12884 KB |
Output is correct |
11 |
Correct |
53 ms |
12536 KB |
Output is correct |
12 |
Correct |
43 ms |
11860 KB |
Output is correct |
13 |
Correct |
45 ms |
11636 KB |
Output is correct |
14 |
Correct |
53 ms |
15332 KB |
Output is correct |
15 |
Correct |
182 ms |
38084 KB |
Output is correct |
16 |
Correct |
141 ms |
34648 KB |
Output is correct |
17 |
Correct |
134 ms |
34752 KB |
Output is correct |
18 |
Correct |
120 ms |
30608 KB |
Output is correct |
19 |
Correct |
131 ms |
21532 KB |
Output is correct |
20 |
Correct |
107 ms |
16620 KB |
Output is correct |
21 |
Correct |
99 ms |
14096 KB |
Output is correct |
22 |
Correct |
80 ms |
9556 KB |
Output is correct |
23 |
Correct |
52 ms |
10576 KB |
Output is correct |
24 |
Correct |
92 ms |
26356 KB |
Output is correct |
25 |
Correct |
87 ms |
26232 KB |
Output is correct |
26 |
Correct |
81 ms |
24528 KB |
Output is correct |
27 |
Correct |
88 ms |
24152 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
456 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
1 ms |
348 KB |
Output is correct |
60 |
Correct |
1 ms |
348 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
456 KB |
Output is correct |
65 |
Correct |
1 ms |
344 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
1 ms |
344 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
2 ms |
604 KB |
Output is correct |
70 |
Correct |
1 ms |
604 KB |
Output is correct |
71 |
Correct |
1 ms |
344 KB |
Output is correct |
72 |
Correct |
1 ms |
348 KB |
Output is correct |
73 |
Correct |
1 ms |
348 KB |
Output is correct |
74 |
Correct |
1 ms |
344 KB |
Output is correct |
75 |
Correct |
1 ms |
456 KB |
Output is correct |
76 |
Correct |
1 ms |
348 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
2 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
800 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 |
604 KB |
Output is correct |
83 |
Correct |
1 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 |
348 KB |
Output is correct |
90 |
Correct |
1 ms |
348 KB |
Output is correct |
91 |
Correct |
1 ms |
600 KB |
Output is correct |
92 |
Correct |
1 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
456 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
1 ms |
348 KB |
Output is correct |
60 |
Correct |
1 ms |
348 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
456 KB |
Output is correct |
65 |
Correct |
1 ms |
344 KB |
Output is correct |
66 |
Correct |
65 ms |
27796 KB |
Output is correct |
67 |
Correct |
75 ms |
27780 KB |
Output is correct |
68 |
Correct |
134 ms |
31428 KB |
Output is correct |
69 |
Correct |
84 ms |
25504 KB |
Output is correct |
70 |
Correct |
108 ms |
24016 KB |
Output is correct |
71 |
Correct |
128 ms |
30028 KB |
Output is correct |
72 |
Correct |
103 ms |
19296 KB |
Output is correct |
73 |
Correct |
110 ms |
22972 KB |
Output is correct |
74 |
Correct |
103 ms |
14304 KB |
Output is correct |
75 |
Correct |
111 ms |
16460 KB |
Output is correct |
76 |
Correct |
48 ms |
9052 KB |
Output is correct |
77 |
Correct |
50 ms |
9976 KB |
Output is correct |
78 |
Correct |
47 ms |
9808 KB |
Output is correct |
79 |
Correct |
42 ms |
9640 KB |
Output is correct |
80 |
Correct |
33 ms |
9052 KB |
Output is correct |
81 |
Correct |
34 ms |
9048 KB |
Output is correct |
82 |
Correct |
6 ms |
5720 KB |
Output is correct |
83 |
Correct |
6 ms |
5724 KB |
Output is correct |
84 |
Correct |
6 ms |
5720 KB |
Output is correct |
85 |
Correct |
6 ms |
5724 KB |
Output is correct |
86 |
Correct |
6 ms |
5724 KB |
Output is correct |
87 |
Correct |
6 ms |
5964 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
576 KB |
Output is correct |
90 |
Correct |
1 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
856 KB |
Output is correct |
92 |
Correct |
2 ms |
860 KB |
Output is correct |
93 |
Correct |
2 ms |
856 KB |
Output is correct |
94 |
Correct |
1 ms |
860 KB |
Output is correct |
95 |
Correct |
2 ms |
604 KB |
Output is correct |
96 |
Correct |
1 ms |
604 KB |
Output is correct |
97 |
Correct |
2 ms |
856 KB |
Output is correct |
98 |
Correct |
2 ms |
604 KB |
Output is correct |
99 |
Correct |
2 ms |
604 KB |
Output is correct |
100 |
Correct |
1 ms |
604 KB |
Output is correct |
101 |
Correct |
1 ms |
348 KB |
Output is correct |
102 |
Correct |
1 ms |
348 KB |
Output is correct |
103 |
Correct |
1 ms |
344 KB |
Output is correct |
104 |
Correct |
2 ms |
600 KB |
Output is correct |
105 |
Correct |
1 ms |
604 KB |
Output is correct |
106 |
Correct |
1 ms |
604 KB |
Output is correct |
107 |
Correct |
1 ms |
604 KB |
Output is correct |
108 |
Correct |
106 ms |
27512 KB |
Output is correct |
109 |
Correct |
109 ms |
27508 KB |
Output is correct |
110 |
Correct |
106 ms |
27660 KB |
Output is correct |
111 |
Correct |
112 ms |
27248 KB |
Output is correct |
112 |
Correct |
134 ms |
27684 KB |
Output is correct |
113 |
Correct |
167 ms |
45948 KB |
Output is correct |
114 |
Correct |
148 ms |
39484 KB |
Output is correct |
115 |
Correct |
141 ms |
36716 KB |
Output is correct |
116 |
Correct |
131 ms |
33536 KB |
Output is correct |
117 |
Correct |
103 ms |
19584 KB |
Output is correct |
118 |
Correct |
122 ms |
24952 KB |
Output is correct |
119 |
Correct |
102 ms |
15140 KB |
Output is correct |
120 |
Correct |
104 ms |
14152 KB |
Output is correct |
121 |
Correct |
76 ms |
9296 KB |
Output is correct |
122 |
Correct |
58 ms |
10276 KB |
Output is correct |
123 |
Correct |
37 ms |
8796 KB |
Output is correct |
124 |
Correct |
54 ms |
26812 KB |
Output is correct |
125 |
Correct |
57 ms |
26288 KB |
Output is correct |
126 |
Correct |
56 ms |
26924 KB |
Output is correct |
127 |
Correct |
55 ms |
26048 KB |
Output is correct |
128 |
Correct |
1 ms |
604 KB |
Output is correct |
129 |
Correct |
1 ms |
604 KB |
Output is correct |
130 |
Correct |
1 ms |
600 KB |
Output is correct |
131 |
Correct |
1 ms |
604 KB |
Output is correct |
132 |
Correct |
1 ms |
600 KB |
Output is correct |
133 |
Correct |
1 ms |
604 KB |
Output is correct |
134 |
Correct |
2 ms |
600 KB |
Output is correct |
135 |
Correct |
1 ms |
600 KB |
Output is correct |
136 |
Correct |
1 ms |
348 KB |
Output is correct |
137 |
Correct |
1 ms |
604 KB |
Output is correct |
138 |
Correct |
1 ms |
604 KB |
Output is correct |
139 |
Correct |
2 ms |
856 KB |
Output is correct |
140 |
Correct |
2 ms |
604 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 |
604 KB |
Output is correct |
144 |
Correct |
1 ms |
604 KB |
Output is correct |
145 |
Correct |
1 ms |
348 KB |
Output is correct |
146 |
Correct |
1 ms |
344 KB |
Output is correct |
147 |
Correct |
1 ms |
348 KB |
Output is correct |
148 |
Correct |
1 ms |
604 KB |
Output is correct |
149 |
Correct |
1 ms |
600 KB |
Output is correct |
150 |
Correct |
1 ms |
604 KB |
Output is correct |
151 |
Correct |
1 ms |
604 KB |
Output is correct |
152 |
Correct |
1 ms |
348 KB |
Output is correct |
153 |
Correct |
1 ms |
348 KB |
Output is correct |
154 |
Correct |
1 ms |
348 KB |
Output is correct |
155 |
Correct |
120 ms |
27696 KB |
Output is correct |
156 |
Correct |
118 ms |
27652 KB |
Output is correct |
157 |
Correct |
116 ms |
26080 KB |
Output is correct |
158 |
Correct |
98 ms |
22380 KB |
Output is correct |
159 |
Correct |
77 ms |
17864 KB |
Output is correct |
160 |
Correct |
68 ms |
16008 KB |
Output is correct |
161 |
Correct |
59 ms |
14984 KB |
Output is correct |
162 |
Correct |
55 ms |
13968 KB |
Output is correct |
163 |
Correct |
49 ms |
13200 KB |
Output is correct |
164 |
Correct |
56 ms |
12884 KB |
Output is correct |
165 |
Correct |
53 ms |
12536 KB |
Output is correct |
166 |
Correct |
43 ms |
11860 KB |
Output is correct |
167 |
Correct |
45 ms |
11636 KB |
Output is correct |
168 |
Correct |
53 ms |
15332 KB |
Output is correct |
169 |
Correct |
182 ms |
38084 KB |
Output is correct |
170 |
Correct |
141 ms |
34648 KB |
Output is correct |
171 |
Correct |
134 ms |
34752 KB |
Output is correct |
172 |
Correct |
120 ms |
30608 KB |
Output is correct |
173 |
Correct |
131 ms |
21532 KB |
Output is correct |
174 |
Correct |
107 ms |
16620 KB |
Output is correct |
175 |
Correct |
99 ms |
14096 KB |
Output is correct |
176 |
Correct |
80 ms |
9556 KB |
Output is correct |
177 |
Correct |
52 ms |
10576 KB |
Output is correct |
178 |
Correct |
92 ms |
26356 KB |
Output is correct |
179 |
Correct |
87 ms |
26232 KB |
Output is correct |
180 |
Correct |
81 ms |
24528 KB |
Output is correct |
181 |
Correct |
88 ms |
24152 KB |
Output is correct |
182 |
Correct |
1 ms |
348 KB |
Output is correct |
183 |
Correct |
1 ms |
344 KB |
Output is correct |
184 |
Correct |
1 ms |
604 KB |
Output is correct |
185 |
Correct |
2 ms |
604 KB |
Output is correct |
186 |
Correct |
1 ms |
604 KB |
Output is correct |
187 |
Correct |
1 ms |
344 KB |
Output is correct |
188 |
Correct |
1 ms |
348 KB |
Output is correct |
189 |
Correct |
1 ms |
348 KB |
Output is correct |
190 |
Correct |
1 ms |
344 KB |
Output is correct |
191 |
Correct |
1 ms |
456 KB |
Output is correct |
192 |
Correct |
1 ms |
348 KB |
Output is correct |
193 |
Correct |
1 ms |
604 KB |
Output is correct |
194 |
Correct |
2 ms |
604 KB |
Output is correct |
195 |
Correct |
1 ms |
800 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 |
1 ms |
348 KB |
Output is correct |
206 |
Correct |
1 ms |
348 KB |
Output is correct |
207 |
Correct |
1 ms |
600 KB |
Output is correct |
208 |
Correct |
1 ms |
600 KB |
Output is correct |
209 |
Correct |
5 ms |
5724 KB |
Output is correct |
210 |
Correct |
44 ms |
9728 KB |
Output is correct |
211 |
Correct |
82 ms |
22776 KB |
Output is correct |
212 |
Correct |
117 ms |
29216 KB |
Output is correct |
213 |
Correct |
160 ms |
33472 KB |
Output is correct |
214 |
Correct |
47 ms |
11100 KB |
Output is correct |
215 |
Correct |
48 ms |
11196 KB |
Output is correct |
216 |
Correct |
93 ms |
25712 KB |
Output is correct |
217 |
Correct |
81 ms |
20528 KB |
Output is correct |
218 |
Correct |
53 ms |
15168 KB |
Output is correct |
219 |
Correct |
55 ms |
13824 KB |
Output is correct |
220 |
Correct |
45 ms |
13392 KB |
Output is correct |
221 |
Correct |
65 ms |
12884 KB |
Output is correct |
222 |
Correct |
48 ms |
14796 KB |
Output is correct |
223 |
Correct |
93 ms |
25660 KB |
Output is correct |
224 |
Correct |
87 ms |
24056 KB |
Output is correct |
225 |
Correct |
76 ms |
16776 KB |
Output is correct |
226 |
Correct |
70 ms |
14812 KB |
Output is correct |
227 |
Correct |
70 ms |
14732 KB |
Output is correct |
228 |
Correct |
67 ms |
10836 KB |
Output is correct |
229 |
Correct |
46 ms |
10328 KB |
Output is correct |
230 |
Correct |
67 ms |
19316 KB |
Output is correct |
231 |
Correct |
62 ms |
19072 KB |
Output is correct |