#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5+10;
int n;
pii edge[maxn];
int in[maxn], low[maxn], tt;
bool mark_edge[maxn], art[maxn];
int sz_bcc[maxn], sz_comp;
vector<vector<int>> bcc;
vector<int> tree[maxn];
vector<pii> grafo[maxn];
stack<int> stk;
void make_component(int last)
{
bcc.push_back(vector<int>());
while (!stk.empty())
{
int e = stk.top(); stk.pop();
bcc.back().push_back(e);
if (e == last) break;
}
}
void lowlink(int u, bool isroot)
{
in[u] = low[u] = ++tt;
++sz_comp;
bool fwd = 0;
for (auto pp: grafo[u])
{
int v = pp.ff, e = pp.ss;
if (mark_edge[e]) continue;
mark_edge[e] = 1;
stk.push(e);
if (in[v])
{
low[u] = min(low[u], in[v]);
continue;
}
lowlink(v, 0);
low[u] = min(low[u], low[v]);
if (isroot ? fwd : (low[v] >= in[u]))
{
art[u] = 1;
make_component(e);
}
fwd = 1;
}
}
int sub[maxn];
bool vis[maxn];
ll ans, dp[maxn];
ll choose2(int x)
{
return 1ll*x*(x-1)/2ll;
}
ll choose3(int x)
{
return 1ll*x*(x-1)*(x-2);
}
void dfs(int u, int p)
{
vis[u] = 1;
sub[u] = (u <= n ? 1 : sz_bcc[u]);
for (auto v: tree[u])
{
if (v == p) continue;
dfs(v, u);
sub[u] += sub[v];
dp[u] += dp[v];
}
if (u <= n) dp[u] = choose2(sub[u]);
}
void solve(int u, int p)
{
for (auto v: tree[u])
ans -= 2ll*(u <= n ? 1 : sz_bcc[u])*dp[v];
for (auto v: tree[u])
{
if (v == p) continue;
int old_sub_v = sub[v], old_sub_u = sub[u];
ll old_dp_v = dp[v], old_dp_u = dp[u];
if (u <= n)
{
int sz = sz_bcc[v];
dp[u] = choose2(sub[u]-sub[v]);
dp[v] += dp[u];
}
else
{
int sz = sz_bcc[u];
dp[u] -= dp[v];
dp[v] = choose2(sub[u]);
}
sub[v] = sub[u];
sub[u] -= old_sub_v;
solve(v, u);
sub[v] = old_sub_v, sub[u] = old_sub_u;
dp[v] = old_dp_v, dp[u] = old_dp_u;
}
}
int main(void)
{
int m;
scanf("%d %d", &n, &m);
for (int i = 1; i <= m; i++)
{
int u, v;
scanf("%d %d", &u, &v);
grafo[u].push_back({v, i});
grafo[v].push_back({u, i});
edge[i] = {u, v};
}
for (int i = 1; i <= n; i++)
{
if (in[i]) continue;
tt = 0;
sz_comp = 0;
int l = bcc.size();
lowlink(i, 1);
make_component(0);
int r = bcc.size();
ans += choose3(sz_comp);
for (int j = l; j < r; j++)
{
vector<int> v;
for (auto e: bcc[j])
{
v.push_back(edge[e].ff);
v.push_back(edge[e].ss);
}
sort(all(v));
v.erase(unique(all(v)), v.end());
for (auto u: v)
{
if (art[u])
{
tree[n+j+1].push_back(u);
tree[u].push_back(n+j+1);
}
else
{
sz_bcc[n+j+1]++;
}
}
}
}
for (int i = 1; i <= 2*n; i++)
{
if (!vis[i] && tree[i].size())
{
dfs(i, 0);
solve(i, 0);
}
}
printf("%lld\n", ans);
}
Compilation message
count_triplets.cpp: In function 'void solve(int, int)':
count_triplets.cpp:126:8: warning: unused variable 'sz' [-Wunused-variable]
126 | int sz = sz_bcc[v];
| ^~
count_triplets.cpp:133:8: warning: unused variable 'sz' [-Wunused-variable]
133 | int sz = sz_bcc[u];
| ^~
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:152:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
152 | scanf("%d %d", &n, &m);
| ~~~~~^~~~~~~~~~~~~~~~~
count_triplets.cpp:157:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
157 | scanf("%d %d", &u, &v);
| ~~~~~^~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9708 KB |
Output is correct |
2 |
Correct |
6 ms |
9708 KB |
Output is correct |
3 |
Correct |
6 ms |
9708 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
6 ms |
9708 KB |
Output is correct |
6 |
Correct |
6 ms |
9708 KB |
Output is correct |
7 |
Correct |
7 ms |
9708 KB |
Output is correct |
8 |
Correct |
7 ms |
9708 KB |
Output is correct |
9 |
Correct |
7 ms |
9708 KB |
Output is correct |
10 |
Correct |
6 ms |
9708 KB |
Output is correct |
11 |
Correct |
6 ms |
9708 KB |
Output is correct |
12 |
Correct |
6 ms |
9708 KB |
Output is correct |
13 |
Correct |
7 ms |
9708 KB |
Output is correct |
14 |
Correct |
8 ms |
9708 KB |
Output is correct |
15 |
Correct |
6 ms |
9708 KB |
Output is correct |
16 |
Correct |
6 ms |
9708 KB |
Output is correct |
17 |
Correct |
7 ms |
9708 KB |
Output is correct |
18 |
Correct |
7 ms |
9708 KB |
Output is correct |
19 |
Correct |
6 ms |
9708 KB |
Output is correct |
20 |
Correct |
6 ms |
9708 KB |
Output is correct |
21 |
Correct |
6 ms |
9708 KB |
Output is correct |
22 |
Correct |
7 ms |
9708 KB |
Output is correct |
23 |
Correct |
6 ms |
9708 KB |
Output is correct |
24 |
Correct |
7 ms |
9708 KB |
Output is correct |
25 |
Correct |
7 ms |
9708 KB |
Output is correct |
26 |
Correct |
6 ms |
9708 KB |
Output is correct |
27 |
Correct |
6 ms |
9708 KB |
Output is correct |
28 |
Correct |
7 ms |
9708 KB |
Output is correct |
29 |
Correct |
7 ms |
9708 KB |
Output is correct |
30 |
Correct |
6 ms |
9708 KB |
Output is correct |
31 |
Correct |
6 ms |
9708 KB |
Output is correct |
32 |
Correct |
6 ms |
9708 KB |
Output is correct |
33 |
Correct |
6 ms |
9708 KB |
Output is correct |
34 |
Correct |
6 ms |
9728 KB |
Output is correct |
35 |
Correct |
6 ms |
9708 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9708 KB |
Output is correct |
2 |
Correct |
6 ms |
9708 KB |
Output is correct |
3 |
Correct |
6 ms |
9708 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
6 ms |
9708 KB |
Output is correct |
6 |
Correct |
6 ms |
9708 KB |
Output is correct |
7 |
Correct |
7 ms |
9708 KB |
Output is correct |
8 |
Correct |
7 ms |
9708 KB |
Output is correct |
9 |
Correct |
7 ms |
9708 KB |
Output is correct |
10 |
Correct |
6 ms |
9708 KB |
Output is correct |
11 |
Correct |
6 ms |
9708 KB |
Output is correct |
12 |
Correct |
6 ms |
9708 KB |
Output is correct |
13 |
Correct |
7 ms |
9708 KB |
Output is correct |
14 |
Correct |
8 ms |
9708 KB |
Output is correct |
15 |
Correct |
6 ms |
9708 KB |
Output is correct |
16 |
Correct |
6 ms |
9708 KB |
Output is correct |
17 |
Correct |
7 ms |
9708 KB |
Output is correct |
18 |
Correct |
7 ms |
9708 KB |
Output is correct |
19 |
Correct |
6 ms |
9708 KB |
Output is correct |
20 |
Correct |
6 ms |
9708 KB |
Output is correct |
21 |
Correct |
6 ms |
9708 KB |
Output is correct |
22 |
Correct |
7 ms |
9708 KB |
Output is correct |
23 |
Correct |
6 ms |
9708 KB |
Output is correct |
24 |
Correct |
7 ms |
9708 KB |
Output is correct |
25 |
Correct |
7 ms |
9708 KB |
Output is correct |
26 |
Correct |
6 ms |
9708 KB |
Output is correct |
27 |
Correct |
6 ms |
9708 KB |
Output is correct |
28 |
Correct |
7 ms |
9708 KB |
Output is correct |
29 |
Correct |
7 ms |
9708 KB |
Output is correct |
30 |
Correct |
6 ms |
9708 KB |
Output is correct |
31 |
Correct |
6 ms |
9708 KB |
Output is correct |
32 |
Correct |
6 ms |
9708 KB |
Output is correct |
33 |
Correct |
6 ms |
9708 KB |
Output is correct |
34 |
Correct |
6 ms |
9728 KB |
Output is correct |
35 |
Correct |
6 ms |
9708 KB |
Output is correct |
36 |
Correct |
6 ms |
9708 KB |
Output is correct |
37 |
Correct |
6 ms |
9708 KB |
Output is correct |
38 |
Correct |
6 ms |
9708 KB |
Output is correct |
39 |
Correct |
7 ms |
9708 KB |
Output is correct |
40 |
Correct |
7 ms |
9708 KB |
Output is correct |
41 |
Correct |
7 ms |
9708 KB |
Output is correct |
42 |
Correct |
6 ms |
9708 KB |
Output is correct |
43 |
Correct |
6 ms |
9708 KB |
Output is correct |
44 |
Correct |
6 ms |
9708 KB |
Output is correct |
45 |
Correct |
6 ms |
9708 KB |
Output is correct |
46 |
Correct |
6 ms |
9708 KB |
Output is correct |
47 |
Correct |
6 ms |
9708 KB |
Output is correct |
48 |
Correct |
6 ms |
9708 KB |
Output is correct |
49 |
Correct |
7 ms |
9708 KB |
Output is correct |
50 |
Correct |
7 ms |
9708 KB |
Output is correct |
51 |
Correct |
7 ms |
9708 KB |
Output is correct |
52 |
Correct |
7 ms |
9708 KB |
Output is correct |
53 |
Correct |
6 ms |
9708 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
7 ms |
9708 KB |
Output is correct |
56 |
Correct |
6 ms |
9708 KB |
Output is correct |
57 |
Correct |
6 ms |
9708 KB |
Output is correct |
58 |
Correct |
6 ms |
9708 KB |
Output is correct |
59 |
Correct |
7 ms |
9708 KB |
Output is correct |
60 |
Correct |
7 ms |
9708 KB |
Output is correct |
61 |
Correct |
7 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9708 KB |
Output is correct |
63 |
Correct |
6 ms |
9708 KB |
Output is correct |
64 |
Correct |
6 ms |
9708 KB |
Output is correct |
65 |
Correct |
7 ms |
9708 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
27624 KB |
Output is correct |
2 |
Correct |
96 ms |
27624 KB |
Output is correct |
3 |
Correct |
125 ms |
31704 KB |
Output is correct |
4 |
Correct |
121 ms |
28500 KB |
Output is correct |
5 |
Correct |
118 ms |
26480 KB |
Output is correct |
6 |
Correct |
142 ms |
30816 KB |
Output is correct |
7 |
Correct |
155 ms |
28704 KB |
Output is correct |
8 |
Correct |
137 ms |
29376 KB |
Output is correct |
9 |
Correct |
135 ms |
26272 KB |
Output is correct |
10 |
Correct |
132 ms |
25760 KB |
Output is correct |
11 |
Correct |
97 ms |
21280 KB |
Output is correct |
12 |
Correct |
100 ms |
21280 KB |
Output is correct |
13 |
Correct |
93 ms |
20640 KB |
Output is correct |
14 |
Correct |
94 ms |
20640 KB |
Output is correct |
15 |
Correct |
64 ms |
19360 KB |
Output is correct |
16 |
Correct |
67 ms |
19360 KB |
Output is correct |
17 |
Correct |
13 ms |
13924 KB |
Output is correct |
18 |
Correct |
13 ms |
13924 KB |
Output is correct |
19 |
Correct |
13 ms |
14068 KB |
Output is correct |
20 |
Correct |
13 ms |
13920 KB |
Output is correct |
21 |
Correct |
12 ms |
13920 KB |
Output is correct |
22 |
Correct |
12 ms |
13920 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
9964 KB |
Output is correct |
2 |
Correct |
7 ms |
9964 KB |
Output is correct |
3 |
Correct |
7 ms |
9964 KB |
Output is correct |
4 |
Correct |
7 ms |
10092 KB |
Output is correct |
5 |
Correct |
8 ms |
10092 KB |
Output is correct |
6 |
Correct |
7 ms |
10092 KB |
Output is correct |
7 |
Correct |
7 ms |
10092 KB |
Output is correct |
8 |
Correct |
8 ms |
9964 KB |
Output is correct |
9 |
Correct |
7 ms |
9964 KB |
Output is correct |
10 |
Correct |
7 ms |
9964 KB |
Output is correct |
11 |
Correct |
7 ms |
9964 KB |
Output is correct |
12 |
Correct |
7 ms |
9964 KB |
Output is correct |
13 |
Correct |
7 ms |
9964 KB |
Output is correct |
14 |
Correct |
7 ms |
9964 KB |
Output is correct |
15 |
Correct |
8 ms |
9964 KB |
Output is correct |
16 |
Correct |
7 ms |
9836 KB |
Output is correct |
17 |
Correct |
7 ms |
9964 KB |
Output is correct |
18 |
Correct |
7 ms |
9964 KB |
Output is correct |
19 |
Correct |
7 ms |
9964 KB |
Output is correct |
20 |
Correct |
7 ms |
9964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
28572 KB |
Output is correct |
2 |
Correct |
135 ms |
28572 KB |
Output is correct |
3 |
Correct |
141 ms |
28444 KB |
Output is correct |
4 |
Correct |
137 ms |
28444 KB |
Output is correct |
5 |
Correct |
138 ms |
28444 KB |
Output is correct |
6 |
Correct |
188 ms |
40972 KB |
Output is correct |
7 |
Correct |
150 ms |
36892 KB |
Output is correct |
8 |
Correct |
150 ms |
36248 KB |
Output is correct |
9 |
Correct |
151 ms |
33692 KB |
Output is correct |
10 |
Correct |
140 ms |
28444 KB |
Output is correct |
11 |
Correct |
131 ms |
28444 KB |
Output is correct |
12 |
Correct |
139 ms |
28572 KB |
Output is correct |
13 |
Correct |
156 ms |
28572 KB |
Output is correct |
14 |
Correct |
135 ms |
27036 KB |
Output is correct |
15 |
Correct |
117 ms |
25500 KB |
Output is correct |
16 |
Correct |
72 ms |
21148 KB |
Output is correct |
17 |
Correct |
84 ms |
26072 KB |
Output is correct |
18 |
Correct |
95 ms |
26064 KB |
Output is correct |
19 |
Correct |
85 ms |
26312 KB |
Output is correct |
20 |
Correct |
99 ms |
26252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
9964 KB |
Output is correct |
2 |
Correct |
7 ms |
9964 KB |
Output is correct |
3 |
Correct |
7 ms |
9964 KB |
Output is correct |
4 |
Correct |
7 ms |
9964 KB |
Output is correct |
5 |
Correct |
7 ms |
9836 KB |
Output is correct |
6 |
Correct |
7 ms |
9836 KB |
Output is correct |
7 |
Correct |
7 ms |
9836 KB |
Output is correct |
8 |
Correct |
7 ms |
9836 KB |
Output is correct |
9 |
Correct |
7 ms |
9836 KB |
Output is correct |
10 |
Correct |
7 ms |
9836 KB |
Output is correct |
11 |
Correct |
7 ms |
9836 KB |
Output is correct |
12 |
Correct |
8 ms |
10092 KB |
Output is correct |
13 |
Correct |
7 ms |
9964 KB |
Output is correct |
14 |
Correct |
7 ms |
9964 KB |
Output is correct |
15 |
Correct |
7 ms |
9964 KB |
Output is correct |
16 |
Correct |
7 ms |
9964 KB |
Output is correct |
17 |
Correct |
7 ms |
9964 KB |
Output is correct |
18 |
Correct |
7 ms |
9964 KB |
Output is correct |
19 |
Correct |
7 ms |
9836 KB |
Output is correct |
20 |
Correct |
7 ms |
9836 KB |
Output is correct |
21 |
Correct |
8 ms |
9964 KB |
Output is correct |
22 |
Correct |
7 ms |
9984 KB |
Output is correct |
23 |
Correct |
7 ms |
9964 KB |
Output is correct |
24 |
Correct |
8 ms |
10092 KB |
Output is correct |
25 |
Correct |
7 ms |
9836 KB |
Output is correct |
26 |
Correct |
7 ms |
9836 KB |
Output is correct |
27 |
Correct |
7 ms |
9836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
28444 KB |
Output is correct |
2 |
Correct |
134 ms |
28700 KB |
Output is correct |
3 |
Correct |
140 ms |
27104 KB |
Output is correct |
4 |
Correct |
143 ms |
26084 KB |
Output is correct |
5 |
Correct |
130 ms |
22688 KB |
Output is correct |
6 |
Correct |
106 ms |
21284 KB |
Output is correct |
7 |
Correct |
111 ms |
20516 KB |
Output is correct |
8 |
Correct |
91 ms |
19624 KB |
Output is correct |
9 |
Correct |
93 ms |
19240 KB |
Output is correct |
10 |
Correct |
95 ms |
19052 KB |
Output is correct |
11 |
Correct |
87 ms |
18412 KB |
Output is correct |
12 |
Correct |
86 ms |
18156 KB |
Output is correct |
13 |
Correct |
84 ms |
18156 KB |
Output is correct |
14 |
Correct |
91 ms |
19964 KB |
Output is correct |
15 |
Correct |
169 ms |
37340 KB |
Output is correct |
16 |
Correct |
167 ms |
34360 KB |
Output is correct |
17 |
Correct |
160 ms |
36268 KB |
Output is correct |
18 |
Correct |
165 ms |
31896 KB |
Output is correct |
19 |
Correct |
134 ms |
25956 KB |
Output is correct |
20 |
Correct |
167 ms |
25944 KB |
Output is correct |
21 |
Correct |
135 ms |
25956 KB |
Output is correct |
22 |
Correct |
131 ms |
24240 KB |
Output is correct |
23 |
Correct |
110 ms |
22060 KB |
Output is correct |
24 |
Correct |
135 ms |
28048 KB |
Output is correct |
25 |
Correct |
131 ms |
28056 KB |
Output is correct |
26 |
Correct |
129 ms |
26592 KB |
Output is correct |
27 |
Correct |
154 ms |
26616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9708 KB |
Output is correct |
2 |
Correct |
6 ms |
9708 KB |
Output is correct |
3 |
Correct |
6 ms |
9708 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
6 ms |
9708 KB |
Output is correct |
6 |
Correct |
6 ms |
9708 KB |
Output is correct |
7 |
Correct |
7 ms |
9708 KB |
Output is correct |
8 |
Correct |
7 ms |
9708 KB |
Output is correct |
9 |
Correct |
7 ms |
9708 KB |
Output is correct |
10 |
Correct |
6 ms |
9708 KB |
Output is correct |
11 |
Correct |
6 ms |
9708 KB |
Output is correct |
12 |
Correct |
6 ms |
9708 KB |
Output is correct |
13 |
Correct |
7 ms |
9708 KB |
Output is correct |
14 |
Correct |
8 ms |
9708 KB |
Output is correct |
15 |
Correct |
6 ms |
9708 KB |
Output is correct |
16 |
Correct |
6 ms |
9708 KB |
Output is correct |
17 |
Correct |
7 ms |
9708 KB |
Output is correct |
18 |
Correct |
7 ms |
9708 KB |
Output is correct |
19 |
Correct |
6 ms |
9708 KB |
Output is correct |
20 |
Correct |
6 ms |
9708 KB |
Output is correct |
21 |
Correct |
6 ms |
9708 KB |
Output is correct |
22 |
Correct |
7 ms |
9708 KB |
Output is correct |
23 |
Correct |
6 ms |
9708 KB |
Output is correct |
24 |
Correct |
7 ms |
9708 KB |
Output is correct |
25 |
Correct |
7 ms |
9708 KB |
Output is correct |
26 |
Correct |
6 ms |
9708 KB |
Output is correct |
27 |
Correct |
6 ms |
9708 KB |
Output is correct |
28 |
Correct |
7 ms |
9708 KB |
Output is correct |
29 |
Correct |
7 ms |
9708 KB |
Output is correct |
30 |
Correct |
6 ms |
9708 KB |
Output is correct |
31 |
Correct |
6 ms |
9708 KB |
Output is correct |
32 |
Correct |
6 ms |
9708 KB |
Output is correct |
33 |
Correct |
6 ms |
9708 KB |
Output is correct |
34 |
Correct |
6 ms |
9728 KB |
Output is correct |
35 |
Correct |
6 ms |
9708 KB |
Output is correct |
36 |
Correct |
6 ms |
9708 KB |
Output is correct |
37 |
Correct |
6 ms |
9708 KB |
Output is correct |
38 |
Correct |
6 ms |
9708 KB |
Output is correct |
39 |
Correct |
7 ms |
9708 KB |
Output is correct |
40 |
Correct |
7 ms |
9708 KB |
Output is correct |
41 |
Correct |
7 ms |
9708 KB |
Output is correct |
42 |
Correct |
6 ms |
9708 KB |
Output is correct |
43 |
Correct |
6 ms |
9708 KB |
Output is correct |
44 |
Correct |
6 ms |
9708 KB |
Output is correct |
45 |
Correct |
6 ms |
9708 KB |
Output is correct |
46 |
Correct |
6 ms |
9708 KB |
Output is correct |
47 |
Correct |
6 ms |
9708 KB |
Output is correct |
48 |
Correct |
6 ms |
9708 KB |
Output is correct |
49 |
Correct |
7 ms |
9708 KB |
Output is correct |
50 |
Correct |
7 ms |
9708 KB |
Output is correct |
51 |
Correct |
7 ms |
9708 KB |
Output is correct |
52 |
Correct |
7 ms |
9708 KB |
Output is correct |
53 |
Correct |
6 ms |
9708 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
7 ms |
9708 KB |
Output is correct |
56 |
Correct |
6 ms |
9708 KB |
Output is correct |
57 |
Correct |
6 ms |
9708 KB |
Output is correct |
58 |
Correct |
6 ms |
9708 KB |
Output is correct |
59 |
Correct |
7 ms |
9708 KB |
Output is correct |
60 |
Correct |
7 ms |
9708 KB |
Output is correct |
61 |
Correct |
7 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9708 KB |
Output is correct |
63 |
Correct |
6 ms |
9708 KB |
Output is correct |
64 |
Correct |
6 ms |
9708 KB |
Output is correct |
65 |
Correct |
7 ms |
9708 KB |
Output is correct |
66 |
Correct |
7 ms |
9836 KB |
Output is correct |
67 |
Correct |
7 ms |
9836 KB |
Output is correct |
68 |
Correct |
7 ms |
9964 KB |
Output is correct |
69 |
Correct |
8 ms |
9964 KB |
Output is correct |
70 |
Correct |
8 ms |
10092 KB |
Output is correct |
71 |
Correct |
7 ms |
9836 KB |
Output is correct |
72 |
Correct |
7 ms |
9964 KB |
Output is correct |
73 |
Correct |
9 ms |
9836 KB |
Output is correct |
74 |
Correct |
7 ms |
9836 KB |
Output is correct |
75 |
Correct |
7 ms |
9836 KB |
Output is correct |
76 |
Correct |
7 ms |
9836 KB |
Output is correct |
77 |
Correct |
8 ms |
9964 KB |
Output is correct |
78 |
Correct |
8 ms |
9836 KB |
Output is correct |
79 |
Correct |
7 ms |
9836 KB |
Output is correct |
80 |
Correct |
7 ms |
9836 KB |
Output is correct |
81 |
Correct |
7 ms |
9836 KB |
Output is correct |
82 |
Correct |
7 ms |
9964 KB |
Output is correct |
83 |
Correct |
8 ms |
9964 KB |
Output is correct |
84 |
Correct |
8 ms |
9964 KB |
Output is correct |
85 |
Correct |
7 ms |
9964 KB |
Output is correct |
86 |
Correct |
8 ms |
9836 KB |
Output is correct |
87 |
Correct |
8 ms |
9836 KB |
Output is correct |
88 |
Correct |
8 ms |
9836 KB |
Output is correct |
89 |
Correct |
7 ms |
9836 KB |
Output is correct |
90 |
Correct |
7 ms |
9836 KB |
Output is correct |
91 |
Correct |
7 ms |
9836 KB |
Output is correct |
92 |
Correct |
7 ms |
9836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9708 KB |
Output is correct |
2 |
Correct |
6 ms |
9708 KB |
Output is correct |
3 |
Correct |
6 ms |
9708 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
6 ms |
9708 KB |
Output is correct |
6 |
Correct |
6 ms |
9708 KB |
Output is correct |
7 |
Correct |
7 ms |
9708 KB |
Output is correct |
8 |
Correct |
7 ms |
9708 KB |
Output is correct |
9 |
Correct |
7 ms |
9708 KB |
Output is correct |
10 |
Correct |
6 ms |
9708 KB |
Output is correct |
11 |
Correct |
6 ms |
9708 KB |
Output is correct |
12 |
Correct |
6 ms |
9708 KB |
Output is correct |
13 |
Correct |
7 ms |
9708 KB |
Output is correct |
14 |
Correct |
8 ms |
9708 KB |
Output is correct |
15 |
Correct |
6 ms |
9708 KB |
Output is correct |
16 |
Correct |
6 ms |
9708 KB |
Output is correct |
17 |
Correct |
7 ms |
9708 KB |
Output is correct |
18 |
Correct |
7 ms |
9708 KB |
Output is correct |
19 |
Correct |
6 ms |
9708 KB |
Output is correct |
20 |
Correct |
6 ms |
9708 KB |
Output is correct |
21 |
Correct |
6 ms |
9708 KB |
Output is correct |
22 |
Correct |
7 ms |
9708 KB |
Output is correct |
23 |
Correct |
6 ms |
9708 KB |
Output is correct |
24 |
Correct |
7 ms |
9708 KB |
Output is correct |
25 |
Correct |
7 ms |
9708 KB |
Output is correct |
26 |
Correct |
6 ms |
9708 KB |
Output is correct |
27 |
Correct |
6 ms |
9708 KB |
Output is correct |
28 |
Correct |
7 ms |
9708 KB |
Output is correct |
29 |
Correct |
7 ms |
9708 KB |
Output is correct |
30 |
Correct |
6 ms |
9708 KB |
Output is correct |
31 |
Correct |
6 ms |
9708 KB |
Output is correct |
32 |
Correct |
6 ms |
9708 KB |
Output is correct |
33 |
Correct |
6 ms |
9708 KB |
Output is correct |
34 |
Correct |
6 ms |
9728 KB |
Output is correct |
35 |
Correct |
6 ms |
9708 KB |
Output is correct |
36 |
Correct |
6 ms |
9708 KB |
Output is correct |
37 |
Correct |
6 ms |
9708 KB |
Output is correct |
38 |
Correct |
6 ms |
9708 KB |
Output is correct |
39 |
Correct |
7 ms |
9708 KB |
Output is correct |
40 |
Correct |
7 ms |
9708 KB |
Output is correct |
41 |
Correct |
7 ms |
9708 KB |
Output is correct |
42 |
Correct |
6 ms |
9708 KB |
Output is correct |
43 |
Correct |
6 ms |
9708 KB |
Output is correct |
44 |
Correct |
6 ms |
9708 KB |
Output is correct |
45 |
Correct |
6 ms |
9708 KB |
Output is correct |
46 |
Correct |
6 ms |
9708 KB |
Output is correct |
47 |
Correct |
6 ms |
9708 KB |
Output is correct |
48 |
Correct |
6 ms |
9708 KB |
Output is correct |
49 |
Correct |
7 ms |
9708 KB |
Output is correct |
50 |
Correct |
7 ms |
9708 KB |
Output is correct |
51 |
Correct |
7 ms |
9708 KB |
Output is correct |
52 |
Correct |
7 ms |
9708 KB |
Output is correct |
53 |
Correct |
6 ms |
9708 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
7 ms |
9708 KB |
Output is correct |
56 |
Correct |
6 ms |
9708 KB |
Output is correct |
57 |
Correct |
6 ms |
9708 KB |
Output is correct |
58 |
Correct |
6 ms |
9708 KB |
Output is correct |
59 |
Correct |
7 ms |
9708 KB |
Output is correct |
60 |
Correct |
7 ms |
9708 KB |
Output is correct |
61 |
Correct |
7 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9708 KB |
Output is correct |
63 |
Correct |
6 ms |
9708 KB |
Output is correct |
64 |
Correct |
6 ms |
9708 KB |
Output is correct |
65 |
Correct |
7 ms |
9708 KB |
Output is correct |
66 |
Correct |
92 ms |
27624 KB |
Output is correct |
67 |
Correct |
96 ms |
27624 KB |
Output is correct |
68 |
Correct |
125 ms |
31704 KB |
Output is correct |
69 |
Correct |
121 ms |
28500 KB |
Output is correct |
70 |
Correct |
118 ms |
26480 KB |
Output is correct |
71 |
Correct |
142 ms |
30816 KB |
Output is correct |
72 |
Correct |
155 ms |
28704 KB |
Output is correct |
73 |
Correct |
137 ms |
29376 KB |
Output is correct |
74 |
Correct |
135 ms |
26272 KB |
Output is correct |
75 |
Correct |
132 ms |
25760 KB |
Output is correct |
76 |
Correct |
97 ms |
21280 KB |
Output is correct |
77 |
Correct |
100 ms |
21280 KB |
Output is correct |
78 |
Correct |
93 ms |
20640 KB |
Output is correct |
79 |
Correct |
94 ms |
20640 KB |
Output is correct |
80 |
Correct |
64 ms |
19360 KB |
Output is correct |
81 |
Correct |
67 ms |
19360 KB |
Output is correct |
82 |
Correct |
13 ms |
13924 KB |
Output is correct |
83 |
Correct |
13 ms |
13924 KB |
Output is correct |
84 |
Correct |
13 ms |
14068 KB |
Output is correct |
85 |
Correct |
13 ms |
13920 KB |
Output is correct |
86 |
Correct |
12 ms |
13920 KB |
Output is correct |
87 |
Correct |
12 ms |
13920 KB |
Output is correct |
88 |
Correct |
7 ms |
9964 KB |
Output is correct |
89 |
Correct |
7 ms |
9964 KB |
Output is correct |
90 |
Correct |
7 ms |
9964 KB |
Output is correct |
91 |
Correct |
7 ms |
10092 KB |
Output is correct |
92 |
Correct |
8 ms |
10092 KB |
Output is correct |
93 |
Correct |
7 ms |
10092 KB |
Output is correct |
94 |
Correct |
7 ms |
10092 KB |
Output is correct |
95 |
Correct |
8 ms |
9964 KB |
Output is correct |
96 |
Correct |
7 ms |
9964 KB |
Output is correct |
97 |
Correct |
7 ms |
9964 KB |
Output is correct |
98 |
Correct |
7 ms |
9964 KB |
Output is correct |
99 |
Correct |
7 ms |
9964 KB |
Output is correct |
100 |
Correct |
7 ms |
9964 KB |
Output is correct |
101 |
Correct |
7 ms |
9964 KB |
Output is correct |
102 |
Correct |
8 ms |
9964 KB |
Output is correct |
103 |
Correct |
7 ms |
9836 KB |
Output is correct |
104 |
Correct |
7 ms |
9964 KB |
Output is correct |
105 |
Correct |
7 ms |
9964 KB |
Output is correct |
106 |
Correct |
7 ms |
9964 KB |
Output is correct |
107 |
Correct |
7 ms |
9964 KB |
Output is correct |
108 |
Correct |
158 ms |
28572 KB |
Output is correct |
109 |
Correct |
135 ms |
28572 KB |
Output is correct |
110 |
Correct |
141 ms |
28444 KB |
Output is correct |
111 |
Correct |
137 ms |
28444 KB |
Output is correct |
112 |
Correct |
138 ms |
28444 KB |
Output is correct |
113 |
Correct |
188 ms |
40972 KB |
Output is correct |
114 |
Correct |
150 ms |
36892 KB |
Output is correct |
115 |
Correct |
150 ms |
36248 KB |
Output is correct |
116 |
Correct |
151 ms |
33692 KB |
Output is correct |
117 |
Correct |
140 ms |
28444 KB |
Output is correct |
118 |
Correct |
131 ms |
28444 KB |
Output is correct |
119 |
Correct |
139 ms |
28572 KB |
Output is correct |
120 |
Correct |
156 ms |
28572 KB |
Output is correct |
121 |
Correct |
135 ms |
27036 KB |
Output is correct |
122 |
Correct |
117 ms |
25500 KB |
Output is correct |
123 |
Correct |
72 ms |
21148 KB |
Output is correct |
124 |
Correct |
84 ms |
26072 KB |
Output is correct |
125 |
Correct |
95 ms |
26064 KB |
Output is correct |
126 |
Correct |
85 ms |
26312 KB |
Output is correct |
127 |
Correct |
99 ms |
26252 KB |
Output is correct |
128 |
Correct |
7 ms |
9964 KB |
Output is correct |
129 |
Correct |
7 ms |
9964 KB |
Output is correct |
130 |
Correct |
7 ms |
9964 KB |
Output is correct |
131 |
Correct |
7 ms |
9964 KB |
Output is correct |
132 |
Correct |
7 ms |
9836 KB |
Output is correct |
133 |
Correct |
7 ms |
9836 KB |
Output is correct |
134 |
Correct |
7 ms |
9836 KB |
Output is correct |
135 |
Correct |
7 ms |
9836 KB |
Output is correct |
136 |
Correct |
7 ms |
9836 KB |
Output is correct |
137 |
Correct |
7 ms |
9836 KB |
Output is correct |
138 |
Correct |
7 ms |
9836 KB |
Output is correct |
139 |
Correct |
8 ms |
10092 KB |
Output is correct |
140 |
Correct |
7 ms |
9964 KB |
Output is correct |
141 |
Correct |
7 ms |
9964 KB |
Output is correct |
142 |
Correct |
7 ms |
9964 KB |
Output is correct |
143 |
Correct |
7 ms |
9964 KB |
Output is correct |
144 |
Correct |
7 ms |
9964 KB |
Output is correct |
145 |
Correct |
7 ms |
9964 KB |
Output is correct |
146 |
Correct |
7 ms |
9836 KB |
Output is correct |
147 |
Correct |
7 ms |
9836 KB |
Output is correct |
148 |
Correct |
8 ms |
9964 KB |
Output is correct |
149 |
Correct |
7 ms |
9984 KB |
Output is correct |
150 |
Correct |
7 ms |
9964 KB |
Output is correct |
151 |
Correct |
8 ms |
10092 KB |
Output is correct |
152 |
Correct |
7 ms |
9836 KB |
Output is correct |
153 |
Correct |
7 ms |
9836 KB |
Output is correct |
154 |
Correct |
7 ms |
9836 KB |
Output is correct |
155 |
Correct |
158 ms |
28444 KB |
Output is correct |
156 |
Correct |
134 ms |
28700 KB |
Output is correct |
157 |
Correct |
140 ms |
27104 KB |
Output is correct |
158 |
Correct |
143 ms |
26084 KB |
Output is correct |
159 |
Correct |
130 ms |
22688 KB |
Output is correct |
160 |
Correct |
106 ms |
21284 KB |
Output is correct |
161 |
Correct |
111 ms |
20516 KB |
Output is correct |
162 |
Correct |
91 ms |
19624 KB |
Output is correct |
163 |
Correct |
93 ms |
19240 KB |
Output is correct |
164 |
Correct |
95 ms |
19052 KB |
Output is correct |
165 |
Correct |
87 ms |
18412 KB |
Output is correct |
166 |
Correct |
86 ms |
18156 KB |
Output is correct |
167 |
Correct |
84 ms |
18156 KB |
Output is correct |
168 |
Correct |
91 ms |
19964 KB |
Output is correct |
169 |
Correct |
169 ms |
37340 KB |
Output is correct |
170 |
Correct |
167 ms |
34360 KB |
Output is correct |
171 |
Correct |
160 ms |
36268 KB |
Output is correct |
172 |
Correct |
165 ms |
31896 KB |
Output is correct |
173 |
Correct |
134 ms |
25956 KB |
Output is correct |
174 |
Correct |
167 ms |
25944 KB |
Output is correct |
175 |
Correct |
135 ms |
25956 KB |
Output is correct |
176 |
Correct |
131 ms |
24240 KB |
Output is correct |
177 |
Correct |
110 ms |
22060 KB |
Output is correct |
178 |
Correct |
135 ms |
28048 KB |
Output is correct |
179 |
Correct |
131 ms |
28056 KB |
Output is correct |
180 |
Correct |
129 ms |
26592 KB |
Output is correct |
181 |
Correct |
154 ms |
26616 KB |
Output is correct |
182 |
Correct |
7 ms |
9836 KB |
Output is correct |
183 |
Correct |
7 ms |
9836 KB |
Output is correct |
184 |
Correct |
7 ms |
9964 KB |
Output is correct |
185 |
Correct |
8 ms |
9964 KB |
Output is correct |
186 |
Correct |
8 ms |
10092 KB |
Output is correct |
187 |
Correct |
7 ms |
9836 KB |
Output is correct |
188 |
Correct |
7 ms |
9964 KB |
Output is correct |
189 |
Correct |
9 ms |
9836 KB |
Output is correct |
190 |
Correct |
7 ms |
9836 KB |
Output is correct |
191 |
Correct |
7 ms |
9836 KB |
Output is correct |
192 |
Correct |
7 ms |
9836 KB |
Output is correct |
193 |
Correct |
8 ms |
9964 KB |
Output is correct |
194 |
Correct |
8 ms |
9836 KB |
Output is correct |
195 |
Correct |
7 ms |
9836 KB |
Output is correct |
196 |
Correct |
7 ms |
9836 KB |
Output is correct |
197 |
Correct |
7 ms |
9836 KB |
Output is correct |
198 |
Correct |
7 ms |
9964 KB |
Output is correct |
199 |
Correct |
8 ms |
9964 KB |
Output is correct |
200 |
Correct |
8 ms |
9964 KB |
Output is correct |
201 |
Correct |
7 ms |
9964 KB |
Output is correct |
202 |
Correct |
8 ms |
9836 KB |
Output is correct |
203 |
Correct |
8 ms |
9836 KB |
Output is correct |
204 |
Correct |
8 ms |
9836 KB |
Output is correct |
205 |
Correct |
7 ms |
9836 KB |
Output is correct |
206 |
Correct |
7 ms |
9836 KB |
Output is correct |
207 |
Correct |
7 ms |
9836 KB |
Output is correct |
208 |
Correct |
7 ms |
9836 KB |
Output is correct |
209 |
Correct |
13 ms |
13540 KB |
Output is correct |
210 |
Correct |
77 ms |
22300 KB |
Output is correct |
211 |
Correct |
129 ms |
25900 KB |
Output is correct |
212 |
Correct |
157 ms |
28320 KB |
Output is correct |
213 |
Correct |
213 ms |
31972 KB |
Output is correct |
214 |
Correct |
73 ms |
22944 KB |
Output is correct |
215 |
Correct |
74 ms |
22308 KB |
Output is correct |
216 |
Correct |
139 ms |
26780 KB |
Output is correct |
217 |
Correct |
122 ms |
23584 KB |
Output is correct |
218 |
Correct |
106 ms |
19752 KB |
Output is correct |
219 |
Correct |
88 ms |
18796 KB |
Output is correct |
220 |
Correct |
89 ms |
18412 KB |
Output is correct |
221 |
Correct |
96 ms |
18028 KB |
Output is correct |
222 |
Correct |
88 ms |
18416 KB |
Output is correct |
223 |
Correct |
141 ms |
28092 KB |
Output is correct |
224 |
Correct |
136 ms |
27552 KB |
Output is correct |
225 |
Correct |
127 ms |
22816 KB |
Output is correct |
226 |
Correct |
128 ms |
22944 KB |
Output is correct |
227 |
Correct |
125 ms |
22816 KB |
Output is correct |
228 |
Correct |
111 ms |
21540 KB |
Output is correct |
229 |
Correct |
105 ms |
20020 KB |
Output is correct |
230 |
Correct |
112 ms |
21652 KB |
Output is correct |
231 |
Correct |
111 ms |
21920 KB |
Output is correct |