/*************************************
* author: marvinthang *
* created: 17.11.2023 11:19:17 *
*************************************/
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define left ___left
#define right ___right
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define MASK(i) (1LL << (i))
#define BIT(x, i) ((x) >> (i) & 1)
#define __builtin_popcount __builtin_popcountll
#define ALL(v) (v).begin(), (v).end()
#define REP(i, n) for (int i = 0, _n = (n); i < _n; ++i)
#define REPD(i, n) for (int i = (n); i-- > 0; )
#define FOR(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define FORD(i, b, a) for (int i = (b), _a = (a); --i >= _a; )
#define FORE(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define FORDE(i, b, a) for (int i = (b), _a = (a); i >= _a; --i)
#define scan_op(...) istream & operator >> (istream &in, __VA_ARGS__ &u)
#define print_op(...) ostream & operator << (ostream &out, const __VA_ARGS__ &u)
#ifdef LOCAL
#include "debug.h"
#else
#define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
#define DB(...) 23
#define db(...) 23
#define debug(...) 23
#endif
template <class U, class V> scan_op(pair <U, V>) { return in >> u.first >> u.second; }
template <class T> scan_op(vector <T>) { for (size_t i = 0; i < u.size(); ++i) in >> u[i]; return in; }
template <class U, class V> print_op(pair <U, V>) { return out << '(' << u.first << ", " << u.second << ')'; }
template <size_t i, class T> ostream & print_tuple_utils(ostream &out, const T &tup) { if constexpr(i == tuple_size<T>::value) return out << ")"; else return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup); }
template <class ...U> print_op(tuple<U...>) { return print_tuple_utils<0, tuple<U...>>(out, u); }
template <class Con, class = decltype(begin(declval<Con>()))> typename enable_if <!is_same<Con, string>::value, ostream&>::type operator << (ostream &out, const Con &con) { out << '{'; for (__typeof(con.begin()) it = con.begin(); it != con.end(); ++it) out << (it == con.begin() ? "" : ", ") << *it; return out << '}'; }
// end of template
void process(void) {
int n, m; cin >> n >> m;
vector <vector <int>> adj(n), child(n), tree_adj(n + n);
vector <pair <int, int>> edges;
REP(i, m) {
int u, v; cin >> u >> v; --u; --v;
adj[u].push_back(i);
adj[v].push_back(i);
edges.emplace_back(u, v);
}
vector <int> low(n), num(n);
vector <bool> used(m);
int nv = 0;
function <void(int)> dfs = [&] (int u) {
static int tt = 0;
num[u] = ++tt;
low[u] = n + 1;
++nv;
for (int id: adj[u]) if (!used[id]) {
used[id] = true;
int v = edges[id].fi ^ edges[id].se ^ u;
if (!num[v]) {
dfs(v);
low[u] = min(low[u], low[v]);
child[u].push_back(v);
} else low[u] = min(low[u], num[v]);
}
};
int bc_idx = n;
function <void(int, int)> build_tree = [&] (int u, int cur_bc) {
if (cur_bc >= 0) {
tree_adj[u].push_back(cur_bc);
tree_adj[cur_bc].push_back(u);
}
for (int v: child[u]) {
if (low[v] >= num[u]) {
tree_adj[u].push_back(bc_idx);
tree_adj[bc_idx].push_back(u);
build_tree(v, bc_idx++);
} else build_tree(v, cur_bc);
}
};
vector <int> sz(n + n);
vector <long long> sum_pair(n + n);
function <void(int, int)> count_pair = [&] (int u, int par) {
sz[u] = u < n;
for (int v: tree_adj[u]) if (v != par) {
count_pair(v, u);
sz[u] += sz[v];
}
if (u < n) return;
for (int v: tree_adj[u]) {
int t = v == par ? nv - sz[u] : sz[v];
sum_pair[u] += 1LL * t * (t - 1);
}
};
long long res = 0;
function <void(int, int)> solve = [&] (int u, int par) {
if (u < n) {
res += 1LL * (nv - 1) * (nv - 2);
for (int v: tree_adj[u]) {
int t = v == par ? sz[u] : nv - sz[v];
res -= sum_pair[v] - 1LL * t * (t - 1);
}
}
for (int v: tree_adj[u]) if (v != par) solve(v, u);
};
REP(i, n) if (!num[i]) {
nv = 0;
dfs(i);
build_tree(i, -1);
count_pair(i, -1);
solve(i, -1);
}
cout << res << '\n';
}
int main(void) {
ios_base::sync_with_stdio(false); cin.tie(nullptr); // cout.tie(nullptr);
file("duathlon");
// int t; cin >> t; while (t--)
process();
// cerr << "Time elapsed: " << TIME << " s.\n";
return (0^0);
}
Compilation message
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:30:61: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
30 | #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
count_triplets.cpp:127:2: note: in expansion of macro 'file'
127 | file("duathlon");
| ^~~~
count_triplets.cpp:30:94: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
30 | #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
count_triplets.cpp:127:2: note: in expansion of macro 'file'
127 | file("duathlon");
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
456 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 |
452 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 |
600 KB |
Output is correct |
28 |
Correct |
1 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 |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
456 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 |
452 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 |
600 KB |
Output is correct |
28 |
Correct |
1 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 |
600 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
0 ms |
600 KB |
Output is correct |
38 |
Correct |
0 ms |
600 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 |
544 KB |
Output is correct |
42 |
Correct |
0 ms |
348 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 |
344 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 |
456 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
73 ms |
32836 KB |
Output is correct |
2 |
Correct |
70 ms |
32708 KB |
Output is correct |
3 |
Correct |
85 ms |
33736 KB |
Output is correct |
4 |
Correct |
80 ms |
32308 KB |
Output is correct |
5 |
Correct |
92 ms |
31604 KB |
Output is correct |
6 |
Correct |
88 ms |
33588 KB |
Output is correct |
7 |
Correct |
114 ms |
30608 KB |
Output is correct |
8 |
Correct |
93 ms |
31252 KB |
Output is correct |
9 |
Correct |
88 ms |
28504 KB |
Output is correct |
10 |
Correct |
85 ms |
29064 KB |
Output is correct |
11 |
Correct |
75 ms |
24456 KB |
Output is correct |
12 |
Correct |
59 ms |
24304 KB |
Output is correct |
13 |
Correct |
52 ms |
23748 KB |
Output is correct |
14 |
Correct |
53 ms |
23496 KB |
Output is correct |
15 |
Correct |
44 ms |
21852 KB |
Output is correct |
16 |
Correct |
42 ms |
21704 KB |
Output is correct |
17 |
Correct |
7 ms |
12892 KB |
Output is correct |
18 |
Correct |
7 ms |
12892 KB |
Output is correct |
19 |
Correct |
7 ms |
13000 KB |
Output is correct |
20 |
Correct |
7 ms |
13016 KB |
Output is correct |
21 |
Correct |
8 ms |
12908 KB |
Output is correct |
22 |
Correct |
7 ms |
12892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 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 |
852 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
73 ms |
24776 KB |
Output is correct |
2 |
Correct |
86 ms |
25184 KB |
Output is correct |
3 |
Correct |
70 ms |
24980 KB |
Output is correct |
4 |
Correct |
69 ms |
24780 KB |
Output is correct |
5 |
Correct |
88 ms |
24772 KB |
Output is correct |
6 |
Correct |
89 ms |
38232 KB |
Output is correct |
7 |
Correct |
86 ms |
33340 KB |
Output is correct |
8 |
Correct |
81 ms |
31176 KB |
Output is correct |
9 |
Correct |
80 ms |
29128 KB |
Output is correct |
10 |
Correct |
76 ms |
24828 KB |
Output is correct |
11 |
Correct |
85 ms |
26056 KB |
Output is correct |
12 |
Correct |
104 ms |
26052 KB |
Output is correct |
13 |
Correct |
82 ms |
26024 KB |
Output is correct |
14 |
Correct |
68 ms |
25544 KB |
Output is correct |
15 |
Correct |
82 ms |
24592 KB |
Output is correct |
16 |
Correct |
54 ms |
21448 KB |
Output is correct |
17 |
Correct |
57 ms |
25380 KB |
Output is correct |
18 |
Correct |
57 ms |
25544 KB |
Output is correct |
19 |
Correct |
54 ms |
25800 KB |
Output is correct |
20 |
Correct |
59 ms |
25540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
600 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 |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
1 ms |
600 KB |
Output is correct |
21 |
Correct |
1 ms |
604 KB |
Output is correct |
22 |
Correct |
1 ms |
604 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 |
600 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
67 ms |
24776 KB |
Output is correct |
2 |
Correct |
72 ms |
25032 KB |
Output is correct |
3 |
Correct |
77 ms |
24772 KB |
Output is correct |
4 |
Correct |
77 ms |
24480 KB |
Output is correct |
5 |
Correct |
70 ms |
24092 KB |
Output is correct |
6 |
Correct |
67 ms |
23860 KB |
Output is correct |
7 |
Correct |
111 ms |
23752 KB |
Output is correct |
8 |
Correct |
63 ms |
23756 KB |
Output is correct |
9 |
Correct |
77 ms |
23960 KB |
Output is correct |
10 |
Correct |
61 ms |
23752 KB |
Output is correct |
11 |
Correct |
61 ms |
23752 KB |
Output is correct |
12 |
Correct |
57 ms |
24004 KB |
Output is correct |
13 |
Correct |
60 ms |
24004 KB |
Output is correct |
14 |
Correct |
89 ms |
26104 KB |
Output is correct |
15 |
Correct |
121 ms |
33520 KB |
Output is correct |
16 |
Correct |
84 ms |
30660 KB |
Output is correct |
17 |
Correct |
87 ms |
31944 KB |
Output is correct |
18 |
Correct |
83 ms |
29260 KB |
Output is correct |
19 |
Correct |
85 ms |
24612 KB |
Output is correct |
20 |
Correct |
82 ms |
26056 KB |
Output is correct |
21 |
Correct |
98 ms |
25988 KB |
Output is correct |
22 |
Correct |
73 ms |
25284 KB |
Output is correct |
23 |
Correct |
67 ms |
24520 KB |
Output is correct |
24 |
Correct |
72 ms |
26312 KB |
Output is correct |
25 |
Correct |
79 ms |
26508 KB |
Output is correct |
26 |
Correct |
79 ms |
26212 KB |
Output is correct |
27 |
Correct |
71 ms |
26052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
456 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 |
452 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 |
600 KB |
Output is correct |
28 |
Correct |
1 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 |
600 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
0 ms |
600 KB |
Output is correct |
38 |
Correct |
0 ms |
600 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 |
544 KB |
Output is correct |
42 |
Correct |
0 ms |
348 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 |
344 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 |
456 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 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 |
1 ms |
604 KB |
Output is correct |
71 |
Correct |
1 ms |
460 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 |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
1 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
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 |
600 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
600 KB |
Output is correct |
90 |
Correct |
1 ms |
600 KB |
Output is correct |
91 |
Correct |
1 ms |
604 KB |
Output is correct |
92 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
456 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 |
452 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 |
600 KB |
Output is correct |
28 |
Correct |
1 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 |
600 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
0 ms |
600 KB |
Output is correct |
38 |
Correct |
0 ms |
600 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 |
544 KB |
Output is correct |
42 |
Correct |
0 ms |
348 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 |
344 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 |
456 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
73 ms |
32836 KB |
Output is correct |
67 |
Correct |
70 ms |
32708 KB |
Output is correct |
68 |
Correct |
85 ms |
33736 KB |
Output is correct |
69 |
Correct |
80 ms |
32308 KB |
Output is correct |
70 |
Correct |
92 ms |
31604 KB |
Output is correct |
71 |
Correct |
88 ms |
33588 KB |
Output is correct |
72 |
Correct |
114 ms |
30608 KB |
Output is correct |
73 |
Correct |
93 ms |
31252 KB |
Output is correct |
74 |
Correct |
88 ms |
28504 KB |
Output is correct |
75 |
Correct |
85 ms |
29064 KB |
Output is correct |
76 |
Correct |
75 ms |
24456 KB |
Output is correct |
77 |
Correct |
59 ms |
24304 KB |
Output is correct |
78 |
Correct |
52 ms |
23748 KB |
Output is correct |
79 |
Correct |
53 ms |
23496 KB |
Output is correct |
80 |
Correct |
44 ms |
21852 KB |
Output is correct |
81 |
Correct |
42 ms |
21704 KB |
Output is correct |
82 |
Correct |
7 ms |
12892 KB |
Output is correct |
83 |
Correct |
7 ms |
12892 KB |
Output is correct |
84 |
Correct |
7 ms |
13000 KB |
Output is correct |
85 |
Correct |
7 ms |
13016 KB |
Output is correct |
86 |
Correct |
8 ms |
12908 KB |
Output is correct |
87 |
Correct |
7 ms |
12892 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 |
860 KB |
Output is correct |
92 |
Correct |
1 ms |
604 KB |
Output is correct |
93 |
Correct |
1 ms |
604 KB |
Output is correct |
94 |
Correct |
1 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 |
604 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 |
1 ms |
604 KB |
Output is correct |
103 |
Correct |
1 ms |
604 KB |
Output is correct |
104 |
Correct |
1 ms |
852 KB |
Output is correct |
105 |
Correct |
1 ms |
600 KB |
Output is correct |
106 |
Correct |
1 ms |
604 KB |
Output is correct |
107 |
Correct |
1 ms |
604 KB |
Output is correct |
108 |
Correct |
73 ms |
24776 KB |
Output is correct |
109 |
Correct |
86 ms |
25184 KB |
Output is correct |
110 |
Correct |
70 ms |
24980 KB |
Output is correct |
111 |
Correct |
69 ms |
24780 KB |
Output is correct |
112 |
Correct |
88 ms |
24772 KB |
Output is correct |
113 |
Correct |
89 ms |
38232 KB |
Output is correct |
114 |
Correct |
86 ms |
33340 KB |
Output is correct |
115 |
Correct |
81 ms |
31176 KB |
Output is correct |
116 |
Correct |
80 ms |
29128 KB |
Output is correct |
117 |
Correct |
76 ms |
24828 KB |
Output is correct |
118 |
Correct |
85 ms |
26056 KB |
Output is correct |
119 |
Correct |
104 ms |
26052 KB |
Output is correct |
120 |
Correct |
82 ms |
26024 KB |
Output is correct |
121 |
Correct |
68 ms |
25544 KB |
Output is correct |
122 |
Correct |
82 ms |
24592 KB |
Output is correct |
123 |
Correct |
54 ms |
21448 KB |
Output is correct |
124 |
Correct |
57 ms |
25380 KB |
Output is correct |
125 |
Correct |
57 ms |
25544 KB |
Output is correct |
126 |
Correct |
54 ms |
25800 KB |
Output is correct |
127 |
Correct |
59 ms |
25540 KB |
Output is correct |
128 |
Correct |
1 ms |
600 KB |
Output is correct |
129 |
Correct |
1 ms |
604 KB |
Output is correct |
130 |
Correct |
1 ms |
604 KB |
Output is correct |
131 |
Correct |
1 ms |
604 KB |
Output is correct |
132 |
Correct |
1 ms |
604 KB |
Output is correct |
133 |
Correct |
1 ms |
604 KB |
Output is correct |
134 |
Correct |
1 ms |
604 KB |
Output is correct |
135 |
Correct |
1 ms |
604 KB |
Output is correct |
136 |
Correct |
1 ms |
604 KB |
Output is correct |
137 |
Correct |
1 ms |
604 KB |
Output is correct |
138 |
Correct |
1 ms |
604 KB |
Output is correct |
139 |
Correct |
1 ms |
604 KB |
Output is correct |
140 |
Correct |
1 ms |
600 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 |
604 KB |
Output is correct |
146 |
Correct |
1 ms |
600 KB |
Output is correct |
147 |
Correct |
1 ms |
600 KB |
Output is correct |
148 |
Correct |
1 ms |
604 KB |
Output is correct |
149 |
Correct |
1 ms |
604 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 |
600 KB |
Output is correct |
153 |
Correct |
0 ms |
348 KB |
Output is correct |
154 |
Correct |
0 ms |
348 KB |
Output is correct |
155 |
Correct |
67 ms |
24776 KB |
Output is correct |
156 |
Correct |
72 ms |
25032 KB |
Output is correct |
157 |
Correct |
77 ms |
24772 KB |
Output is correct |
158 |
Correct |
77 ms |
24480 KB |
Output is correct |
159 |
Correct |
70 ms |
24092 KB |
Output is correct |
160 |
Correct |
67 ms |
23860 KB |
Output is correct |
161 |
Correct |
111 ms |
23752 KB |
Output is correct |
162 |
Correct |
63 ms |
23756 KB |
Output is correct |
163 |
Correct |
77 ms |
23960 KB |
Output is correct |
164 |
Correct |
61 ms |
23752 KB |
Output is correct |
165 |
Correct |
61 ms |
23752 KB |
Output is correct |
166 |
Correct |
57 ms |
24004 KB |
Output is correct |
167 |
Correct |
60 ms |
24004 KB |
Output is correct |
168 |
Correct |
89 ms |
26104 KB |
Output is correct |
169 |
Correct |
121 ms |
33520 KB |
Output is correct |
170 |
Correct |
84 ms |
30660 KB |
Output is correct |
171 |
Correct |
87 ms |
31944 KB |
Output is correct |
172 |
Correct |
83 ms |
29260 KB |
Output is correct |
173 |
Correct |
85 ms |
24612 KB |
Output is correct |
174 |
Correct |
82 ms |
26056 KB |
Output is correct |
175 |
Correct |
98 ms |
25988 KB |
Output is correct |
176 |
Correct |
73 ms |
25284 KB |
Output is correct |
177 |
Correct |
67 ms |
24520 KB |
Output is correct |
178 |
Correct |
72 ms |
26312 KB |
Output is correct |
179 |
Correct |
79 ms |
26508 KB |
Output is correct |
180 |
Correct |
79 ms |
26212 KB |
Output is correct |
181 |
Correct |
71 ms |
26052 KB |
Output is correct |
182 |
Correct |
1 ms |
348 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 |
1 ms |
460 KB |
Output is correct |
188 |
Correct |
1 ms |
604 KB |
Output is correct |
189 |
Correct |
1 ms |
604 KB |
Output is correct |
190 |
Correct |
1 ms |
604 KB |
Output is correct |
191 |
Correct |
1 ms |
604 KB |
Output is correct |
192 |
Correct |
0 ms |
348 KB |
Output is correct |
193 |
Correct |
1 ms |
604 KB |
Output is correct |
194 |
Correct |
1 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 |
600 KB |
Output is correct |
204 |
Correct |
1 ms |
604 KB |
Output is correct |
205 |
Correct |
1 ms |
600 KB |
Output is correct |
206 |
Correct |
1 ms |
600 KB |
Output is correct |
207 |
Correct |
1 ms |
604 KB |
Output is correct |
208 |
Correct |
1 ms |
604 KB |
Output is correct |
209 |
Correct |
7 ms |
12888 KB |
Output is correct |
210 |
Correct |
53 ms |
20656 KB |
Output is correct |
211 |
Correct |
76 ms |
26096 KB |
Output is correct |
212 |
Correct |
102 ms |
29660 KB |
Output is correct |
213 |
Correct |
99 ms |
32416 KB |
Output is correct |
214 |
Correct |
44 ms |
24516 KB |
Output is correct |
215 |
Correct |
46 ms |
24516 KB |
Output is correct |
216 |
Correct |
84 ms |
26220 KB |
Output is correct |
217 |
Correct |
97 ms |
25800 KB |
Output is correct |
218 |
Correct |
71 ms |
25032 KB |
Output is correct |
219 |
Correct |
61 ms |
24880 KB |
Output is correct |
220 |
Correct |
73 ms |
25036 KB |
Output is correct |
221 |
Correct |
69 ms |
25080 KB |
Output is correct |
222 |
Correct |
78 ms |
26064 KB |
Output is correct |
223 |
Correct |
99 ms |
28872 KB |
Output is correct |
224 |
Correct |
79 ms |
27844 KB |
Output is correct |
225 |
Correct |
110 ms |
25540 KB |
Output is correct |
226 |
Correct |
81 ms |
25536 KB |
Output is correct |
227 |
Correct |
83 ms |
25492 KB |
Output is correct |
228 |
Correct |
72 ms |
25000 KB |
Output is correct |
229 |
Correct |
74 ms |
24524 KB |
Output is correct |
230 |
Correct |
71 ms |
25800 KB |
Output is correct |
231 |
Correct |
76 ms |
25916 KB |
Output is correct |