//DavitMarg
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <bitset>
#include <stack>
#include <cassert>
#include <iterator>
#include <random>
#include <chrono>
#define mod 998244353ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(), v.end()
#define fastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 500005;
int n, m, used[N], art[N];
int a[N], b[N];
vector<pair<int,int>> g[N];
int tin[N], tout[N], low[N], timer;
int color[N], col, cnt[N], num, comp[N];
set<int> s[N], colors[N];
vector<int> st;
void addComp(int ind = 0)
{
if (st.empty())
return;
col++;
while (!st.empty())
{
int j = st.back();
s[col].insert(a[j]);
s[col].insert(b[j]);
colors[a[j]].insert(col);
colors[b[j]].insert(col);
st.pop_back();
if (j == ind)
break;
}
}
void dfs(int v, int p)
{
tin[v] = ++timer;
used[v] = 1;
low[v] = tin[v];
comp[v] = num;
cnt[num]++;
int children = 0;
for (int j = 0; j < g[v].size(); j++)
{
int to = g[v][j].first;
int ind = g[v][j].second;
if (to == p)
continue;
if (used[to])
{
low[v] = min(low[v], tin[to]);
if(low[to] < tin[v])
st.push_back(ind);
continue;
}
children++;
st.push_back(ind);
dfs(to, v);
if (low[to] >= tin[v])
{
art[v] = 1;
addComp(ind);
}
low[v] = min(low[v], low[to]);
}
if (p == 0)
{
art[v] = (children > 1);
addComp();
}
}
int k;
LL sz[N], sb[N], ans, sum;
vector<int> G[N];
void dfs2(int v, int p)
{
used[v] = 1;
sb[v] = sz[v];
vector<LL> sizes;
for (int to : G[v])
{
if (to == p)
continue;
dfs2(to, v);
sb[v] += sb[to];
sizes.push_back(sb[to]);
}
LL psize = sum - sb[v];
if (psize)
sizes.push_back(psize);
if (v > k)
{
LL x = sz[v];
LL y = G[v].size();
LL s = x + y;
for (int i = 0; i < sizes.size(); i++)
{
LL subs = sizes[i];
ans += (s - 1ll) * (subs - 0ll) * (subs - 1ll);
}
}
}
void solve()
{
cin >> n >> m;
for (int i = 1; i <= m; i++)
{
cin >> a[i] >> b[i];
g[a[i]].push_back(MP(b[i], i));
g[b[i]].push_back(MP(a[i], i));
}
for(int i = 1; i <= n; i++)
if (!used[i])
{
num++;
dfs(i, 0);
}
vector<int> ar;
for (int i = 1; i <= n; i++)
{
if (art[i])
ar.push_back(i);
used[i] = 0;
}
k = ar.size();
for (int i = 1; i <= col; i++)
{
LL x = s[i].size();
sz[k + i] = s[i].size();
//ans += x * (x - 1ll) * (x - 2ll);
}
for (int j = 0; j < k; j++)
{
int v = ar[j];
int x = j + 1;
sz[x] = 1ll;
for (auto it = colors[v].begin(); it != colors[v].end(); ++it)
{
int y = (*it) + k;
sz[y]--;
G[x].push_back(y);
G[y].push_back(x);
}
}
for (int i = 1; i <= k; i++)
{
if (used[i])
continue;
int v = ar[i - 1];
sum = cnt[comp[v]];
dfs2(i, 0);
}
ans = -ans;
for (int i = 1; i <= num; i++)
{
LL x = cnt[i];
ans += x * (x - 1ll) * (x - 2ll);
}
cout << ans << endl;
}
int main()
{
fastIO;
int T = 1;
//cin >> T;
while (T--)
{
solve();
}
return 0;
}
/*
4 3
1 2
2 3
3 4
4 4
1 2
2 3
3 4
4 2
8 6
1 2
2 3
3 4
5 6
6 7
7 8
8 10
1 2
2 3
3 1
1 5
5 6
6 1
1 7
7 8
8 1
9 8
5 5
1 2
2 3
3 4
4 2
3 5
1 2 4
1 2 3
1 2 5
3 2 4
4 2 5
*/
Compilation message
count_triplets.cpp: In function 'void dfs(int, int)':
count_triplets.cpp:69:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
69 | for (int j = 0; j < g[v].size(); j++)
| ~~^~~~~~~~~~~~~
count_triplets.cpp: In function 'void dfs2(int, int)':
count_triplets.cpp:132:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
132 | for (int i = 0; i < sizes.size(); i++)
| ~~^~~~~~~~~~~~~~
count_triplets.cpp: In function 'void solve()':
count_triplets.cpp:171:12: warning: unused variable 'x' [-Wunused-variable]
171 | LL x = s[i].size();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
86872 KB |
Output is correct |
2 |
Correct |
16 ms |
86620 KB |
Output is correct |
3 |
Correct |
17 ms |
86804 KB |
Output is correct |
4 |
Correct |
17 ms |
86708 KB |
Output is correct |
5 |
Correct |
16 ms |
86620 KB |
Output is correct |
6 |
Correct |
16 ms |
86744 KB |
Output is correct |
7 |
Correct |
17 ms |
86620 KB |
Output is correct |
8 |
Correct |
17 ms |
86620 KB |
Output is correct |
9 |
Correct |
16 ms |
86616 KB |
Output is correct |
10 |
Correct |
17 ms |
86620 KB |
Output is correct |
11 |
Correct |
16 ms |
86620 KB |
Output is correct |
12 |
Correct |
17 ms |
87128 KB |
Output is correct |
13 |
Correct |
16 ms |
86620 KB |
Output is correct |
14 |
Correct |
16 ms |
86716 KB |
Output is correct |
15 |
Correct |
16 ms |
86616 KB |
Output is correct |
16 |
Correct |
17 ms |
86616 KB |
Output is correct |
17 |
Correct |
16 ms |
86620 KB |
Output is correct |
18 |
Correct |
16 ms |
86824 KB |
Output is correct |
19 |
Correct |
16 ms |
86620 KB |
Output is correct |
20 |
Correct |
16 ms |
86620 KB |
Output is correct |
21 |
Correct |
17 ms |
86620 KB |
Output is correct |
22 |
Correct |
16 ms |
86616 KB |
Output is correct |
23 |
Correct |
17 ms |
86876 KB |
Output is correct |
24 |
Correct |
16 ms |
86616 KB |
Output is correct |
25 |
Correct |
16 ms |
86620 KB |
Output is correct |
26 |
Correct |
16 ms |
86620 KB |
Output is correct |
27 |
Correct |
16 ms |
86620 KB |
Output is correct |
28 |
Correct |
16 ms |
86804 KB |
Output is correct |
29 |
Correct |
16 ms |
86620 KB |
Output is correct |
30 |
Correct |
16 ms |
86616 KB |
Output is correct |
31 |
Correct |
16 ms |
86616 KB |
Output is correct |
32 |
Correct |
16 ms |
86756 KB |
Output is correct |
33 |
Correct |
17 ms |
86756 KB |
Output is correct |
34 |
Correct |
16 ms |
86620 KB |
Output is correct |
35 |
Correct |
17 ms |
86620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
86872 KB |
Output is correct |
2 |
Correct |
16 ms |
86620 KB |
Output is correct |
3 |
Correct |
17 ms |
86804 KB |
Output is correct |
4 |
Correct |
17 ms |
86708 KB |
Output is correct |
5 |
Correct |
16 ms |
86620 KB |
Output is correct |
6 |
Correct |
16 ms |
86744 KB |
Output is correct |
7 |
Correct |
17 ms |
86620 KB |
Output is correct |
8 |
Correct |
17 ms |
86620 KB |
Output is correct |
9 |
Correct |
16 ms |
86616 KB |
Output is correct |
10 |
Correct |
17 ms |
86620 KB |
Output is correct |
11 |
Correct |
16 ms |
86620 KB |
Output is correct |
12 |
Correct |
17 ms |
87128 KB |
Output is correct |
13 |
Correct |
16 ms |
86620 KB |
Output is correct |
14 |
Correct |
16 ms |
86716 KB |
Output is correct |
15 |
Correct |
16 ms |
86616 KB |
Output is correct |
16 |
Correct |
17 ms |
86616 KB |
Output is correct |
17 |
Correct |
16 ms |
86620 KB |
Output is correct |
18 |
Correct |
16 ms |
86824 KB |
Output is correct |
19 |
Correct |
16 ms |
86620 KB |
Output is correct |
20 |
Correct |
16 ms |
86620 KB |
Output is correct |
21 |
Correct |
17 ms |
86620 KB |
Output is correct |
22 |
Correct |
16 ms |
86616 KB |
Output is correct |
23 |
Correct |
17 ms |
86876 KB |
Output is correct |
24 |
Correct |
16 ms |
86616 KB |
Output is correct |
25 |
Correct |
16 ms |
86620 KB |
Output is correct |
26 |
Correct |
16 ms |
86620 KB |
Output is correct |
27 |
Correct |
16 ms |
86620 KB |
Output is correct |
28 |
Correct |
16 ms |
86804 KB |
Output is correct |
29 |
Correct |
16 ms |
86620 KB |
Output is correct |
30 |
Correct |
16 ms |
86616 KB |
Output is correct |
31 |
Correct |
16 ms |
86616 KB |
Output is correct |
32 |
Correct |
16 ms |
86756 KB |
Output is correct |
33 |
Correct |
17 ms |
86756 KB |
Output is correct |
34 |
Correct |
16 ms |
86620 KB |
Output is correct |
35 |
Correct |
17 ms |
86620 KB |
Output is correct |
36 |
Correct |
16 ms |
86620 KB |
Output is correct |
37 |
Correct |
16 ms |
86620 KB |
Output is correct |
38 |
Correct |
16 ms |
86872 KB |
Output is correct |
39 |
Correct |
16 ms |
86844 KB |
Output is correct |
40 |
Correct |
16 ms |
86620 KB |
Output is correct |
41 |
Correct |
16 ms |
86620 KB |
Output is correct |
42 |
Correct |
17 ms |
86620 KB |
Output is correct |
43 |
Correct |
16 ms |
86684 KB |
Output is correct |
44 |
Correct |
16 ms |
86620 KB |
Output is correct |
45 |
Correct |
16 ms |
86796 KB |
Output is correct |
46 |
Correct |
16 ms |
86760 KB |
Output is correct |
47 |
Correct |
16 ms |
86620 KB |
Output is correct |
48 |
Correct |
16 ms |
86620 KB |
Output is correct |
49 |
Correct |
16 ms |
86620 KB |
Output is correct |
50 |
Correct |
16 ms |
86620 KB |
Output is correct |
51 |
Correct |
16 ms |
86620 KB |
Output is correct |
52 |
Correct |
16 ms |
86620 KB |
Output is correct |
53 |
Correct |
16 ms |
86748 KB |
Output is correct |
54 |
Correct |
17 ms |
86616 KB |
Output is correct |
55 |
Correct |
16 ms |
86620 KB |
Output is correct |
56 |
Correct |
17 ms |
86616 KB |
Output is correct |
57 |
Correct |
17 ms |
86620 KB |
Output is correct |
58 |
Correct |
16 ms |
86712 KB |
Output is correct |
59 |
Correct |
17 ms |
86616 KB |
Output is correct |
60 |
Correct |
16 ms |
86620 KB |
Output is correct |
61 |
Correct |
16 ms |
86620 KB |
Output is correct |
62 |
Correct |
17 ms |
86620 KB |
Output is correct |
63 |
Correct |
17 ms |
86620 KB |
Output is correct |
64 |
Correct |
16 ms |
86620 KB |
Output is correct |
65 |
Correct |
16 ms |
86768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
112584 KB |
Output is correct |
2 |
Correct |
111 ms |
112584 KB |
Output is correct |
3 |
Correct |
140 ms |
121860 KB |
Output is correct |
4 |
Correct |
117 ms |
113896 KB |
Output is correct |
5 |
Correct |
138 ms |
113324 KB |
Output is correct |
6 |
Correct |
145 ms |
120784 KB |
Output is correct |
7 |
Correct |
158 ms |
120192 KB |
Output is correct |
8 |
Correct |
136 ms |
121032 KB |
Output is correct |
9 |
Correct |
141 ms |
117720 KB |
Output is correct |
10 |
Correct |
131 ms |
114900 KB |
Output is correct |
11 |
Correct |
91 ms |
105216 KB |
Output is correct |
12 |
Correct |
86 ms |
105260 KB |
Output is correct |
13 |
Correct |
78 ms |
103880 KB |
Output is correct |
14 |
Correct |
78 ms |
103508 KB |
Output is correct |
15 |
Correct |
63 ms |
100024 KB |
Output is correct |
16 |
Correct |
62 ms |
99924 KB |
Output is correct |
17 |
Correct |
18 ms |
87640 KB |
Output is correct |
18 |
Correct |
18 ms |
87640 KB |
Output is correct |
19 |
Correct |
18 ms |
87640 KB |
Output is correct |
20 |
Correct |
18 ms |
87644 KB |
Output is correct |
21 |
Correct |
19 ms |
87600 KB |
Output is correct |
22 |
Correct |
18 ms |
87640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
87056 KB |
Output is correct |
2 |
Correct |
17 ms |
86864 KB |
Output is correct |
3 |
Correct |
18 ms |
86876 KB |
Output is correct |
4 |
Correct |
17 ms |
87132 KB |
Output is correct |
5 |
Correct |
17 ms |
87132 KB |
Output is correct |
6 |
Correct |
17 ms |
87016 KB |
Output is correct |
7 |
Correct |
18 ms |
87132 KB |
Output is correct |
8 |
Correct |
17 ms |
87132 KB |
Output is correct |
9 |
Correct |
17 ms |
87132 KB |
Output is correct |
10 |
Correct |
17 ms |
87132 KB |
Output is correct |
11 |
Correct |
18 ms |
87252 KB |
Output is correct |
12 |
Correct |
17 ms |
87128 KB |
Output is correct |
13 |
Correct |
18 ms |
87128 KB |
Output is correct |
14 |
Correct |
17 ms |
86872 KB |
Output is correct |
15 |
Correct |
17 ms |
86876 KB |
Output is correct |
16 |
Correct |
18 ms |
87128 KB |
Output is correct |
17 |
Correct |
18 ms |
86876 KB |
Output is correct |
18 |
Correct |
17 ms |
86876 KB |
Output is correct |
19 |
Correct |
18 ms |
87128 KB |
Output is correct |
20 |
Correct |
17 ms |
87132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
149 ms |
120528 KB |
Output is correct |
2 |
Correct |
139 ms |
120528 KB |
Output is correct |
3 |
Correct |
167 ms |
120488 KB |
Output is correct |
4 |
Correct |
149 ms |
120600 KB |
Output is correct |
5 |
Correct |
165 ms |
120528 KB |
Output is correct |
6 |
Correct |
198 ms |
135632 KB |
Output is correct |
7 |
Correct |
186 ms |
130764 KB |
Output is correct |
8 |
Correct |
186 ms |
129788 KB |
Output is correct |
9 |
Correct |
158 ms |
126868 KB |
Output is correct |
10 |
Correct |
139 ms |
120528 KB |
Output is correct |
11 |
Correct |
163 ms |
120556 KB |
Output is correct |
12 |
Correct |
145 ms |
120696 KB |
Output is correct |
13 |
Correct |
142 ms |
120524 KB |
Output is correct |
14 |
Correct |
127 ms |
117708 KB |
Output is correct |
15 |
Correct |
117 ms |
114896 KB |
Output is correct |
16 |
Correct |
73 ms |
101752 KB |
Output is correct |
17 |
Correct |
128 ms |
117956 KB |
Output is correct |
18 |
Correct |
112 ms |
118204 KB |
Output is correct |
19 |
Correct |
114 ms |
118328 KB |
Output is correct |
20 |
Correct |
110 ms |
117924 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
87048 KB |
Output is correct |
2 |
Correct |
17 ms |
87132 KB |
Output is correct |
3 |
Correct |
17 ms |
86876 KB |
Output is correct |
4 |
Correct |
17 ms |
86876 KB |
Output is correct |
5 |
Correct |
16 ms |
86872 KB |
Output is correct |
6 |
Correct |
16 ms |
86876 KB |
Output is correct |
7 |
Correct |
17 ms |
86872 KB |
Output is correct |
8 |
Correct |
17 ms |
86876 KB |
Output is correct |
9 |
Correct |
17 ms |
86876 KB |
Output is correct |
10 |
Correct |
17 ms |
86876 KB |
Output is correct |
11 |
Correct |
17 ms |
86876 KB |
Output is correct |
12 |
Correct |
18 ms |
87008 KB |
Output is correct |
13 |
Correct |
17 ms |
87084 KB |
Output is correct |
14 |
Correct |
17 ms |
87132 KB |
Output is correct |
15 |
Correct |
17 ms |
87132 KB |
Output is correct |
16 |
Correct |
18 ms |
86872 KB |
Output is correct |
17 |
Correct |
17 ms |
86872 KB |
Output is correct |
18 |
Correct |
17 ms |
86876 KB |
Output is correct |
19 |
Correct |
17 ms |
86816 KB |
Output is correct |
20 |
Correct |
17 ms |
86872 KB |
Output is correct |
21 |
Correct |
17 ms |
86876 KB |
Output is correct |
22 |
Correct |
17 ms |
87016 KB |
Output is correct |
23 |
Correct |
17 ms |
86876 KB |
Output is correct |
24 |
Correct |
18 ms |
86860 KB |
Output is correct |
25 |
Correct |
18 ms |
86876 KB |
Output is correct |
26 |
Correct |
17 ms |
86620 KB |
Output is correct |
27 |
Correct |
17 ms |
86620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
148 ms |
120504 KB |
Output is correct |
2 |
Correct |
167 ms |
120952 KB |
Output is correct |
3 |
Correct |
144 ms |
118748 KB |
Output is correct |
4 |
Correct |
135 ms |
113360 KB |
Output is correct |
5 |
Correct |
112 ms |
107396 KB |
Output is correct |
6 |
Correct |
107 ms |
105552 KB |
Output is correct |
7 |
Correct |
109 ms |
104468 KB |
Output is correct |
8 |
Correct |
103 ms |
103564 KB |
Output is correct |
9 |
Correct |
95 ms |
102996 KB |
Output is correct |
10 |
Correct |
95 ms |
102736 KB |
Output is correct |
11 |
Correct |
91 ms |
101972 KB |
Output is correct |
12 |
Correct |
93 ms |
101716 KB |
Output is correct |
13 |
Correct |
96 ms |
101800 KB |
Output is correct |
14 |
Correct |
96 ms |
104264 KB |
Output is correct |
15 |
Correct |
179 ms |
128972 KB |
Output is correct |
16 |
Correct |
171 ms |
125652 KB |
Output is correct |
17 |
Correct |
173 ms |
127588 KB |
Output is correct |
18 |
Correct |
159 ms |
122632 KB |
Output is correct |
19 |
Correct |
142 ms |
113296 KB |
Output is correct |
20 |
Correct |
144 ms |
113616 KB |
Output is correct |
21 |
Correct |
132 ms |
113360 KB |
Output is correct |
22 |
Correct |
112 ms |
108240 KB |
Output is correct |
23 |
Correct |
95 ms |
105048 KB |
Output is correct |
24 |
Correct |
150 ms |
116880 KB |
Output is correct |
25 |
Correct |
162 ms |
116524 KB |
Output is correct |
26 |
Correct |
132 ms |
114664 KB |
Output is correct |
27 |
Correct |
138 ms |
114512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
86872 KB |
Output is correct |
2 |
Correct |
16 ms |
86620 KB |
Output is correct |
3 |
Correct |
17 ms |
86804 KB |
Output is correct |
4 |
Correct |
17 ms |
86708 KB |
Output is correct |
5 |
Correct |
16 ms |
86620 KB |
Output is correct |
6 |
Correct |
16 ms |
86744 KB |
Output is correct |
7 |
Correct |
17 ms |
86620 KB |
Output is correct |
8 |
Correct |
17 ms |
86620 KB |
Output is correct |
9 |
Correct |
16 ms |
86616 KB |
Output is correct |
10 |
Correct |
17 ms |
86620 KB |
Output is correct |
11 |
Correct |
16 ms |
86620 KB |
Output is correct |
12 |
Correct |
17 ms |
87128 KB |
Output is correct |
13 |
Correct |
16 ms |
86620 KB |
Output is correct |
14 |
Correct |
16 ms |
86716 KB |
Output is correct |
15 |
Correct |
16 ms |
86616 KB |
Output is correct |
16 |
Correct |
17 ms |
86616 KB |
Output is correct |
17 |
Correct |
16 ms |
86620 KB |
Output is correct |
18 |
Correct |
16 ms |
86824 KB |
Output is correct |
19 |
Correct |
16 ms |
86620 KB |
Output is correct |
20 |
Correct |
16 ms |
86620 KB |
Output is correct |
21 |
Correct |
17 ms |
86620 KB |
Output is correct |
22 |
Correct |
16 ms |
86616 KB |
Output is correct |
23 |
Correct |
17 ms |
86876 KB |
Output is correct |
24 |
Correct |
16 ms |
86616 KB |
Output is correct |
25 |
Correct |
16 ms |
86620 KB |
Output is correct |
26 |
Correct |
16 ms |
86620 KB |
Output is correct |
27 |
Correct |
16 ms |
86620 KB |
Output is correct |
28 |
Correct |
16 ms |
86804 KB |
Output is correct |
29 |
Correct |
16 ms |
86620 KB |
Output is correct |
30 |
Correct |
16 ms |
86616 KB |
Output is correct |
31 |
Correct |
16 ms |
86616 KB |
Output is correct |
32 |
Correct |
16 ms |
86756 KB |
Output is correct |
33 |
Correct |
17 ms |
86756 KB |
Output is correct |
34 |
Correct |
16 ms |
86620 KB |
Output is correct |
35 |
Correct |
17 ms |
86620 KB |
Output is correct |
36 |
Correct |
16 ms |
86620 KB |
Output is correct |
37 |
Correct |
16 ms |
86620 KB |
Output is correct |
38 |
Correct |
16 ms |
86872 KB |
Output is correct |
39 |
Correct |
16 ms |
86844 KB |
Output is correct |
40 |
Correct |
16 ms |
86620 KB |
Output is correct |
41 |
Correct |
16 ms |
86620 KB |
Output is correct |
42 |
Correct |
17 ms |
86620 KB |
Output is correct |
43 |
Correct |
16 ms |
86684 KB |
Output is correct |
44 |
Correct |
16 ms |
86620 KB |
Output is correct |
45 |
Correct |
16 ms |
86796 KB |
Output is correct |
46 |
Correct |
16 ms |
86760 KB |
Output is correct |
47 |
Correct |
16 ms |
86620 KB |
Output is correct |
48 |
Correct |
16 ms |
86620 KB |
Output is correct |
49 |
Correct |
16 ms |
86620 KB |
Output is correct |
50 |
Correct |
16 ms |
86620 KB |
Output is correct |
51 |
Correct |
16 ms |
86620 KB |
Output is correct |
52 |
Correct |
16 ms |
86620 KB |
Output is correct |
53 |
Correct |
16 ms |
86748 KB |
Output is correct |
54 |
Correct |
17 ms |
86616 KB |
Output is correct |
55 |
Correct |
16 ms |
86620 KB |
Output is correct |
56 |
Correct |
17 ms |
86616 KB |
Output is correct |
57 |
Correct |
17 ms |
86620 KB |
Output is correct |
58 |
Correct |
16 ms |
86712 KB |
Output is correct |
59 |
Correct |
17 ms |
86616 KB |
Output is correct |
60 |
Correct |
16 ms |
86620 KB |
Output is correct |
61 |
Correct |
16 ms |
86620 KB |
Output is correct |
62 |
Correct |
17 ms |
86620 KB |
Output is correct |
63 |
Correct |
17 ms |
86620 KB |
Output is correct |
64 |
Correct |
16 ms |
86620 KB |
Output is correct |
65 |
Correct |
16 ms |
86768 KB |
Output is correct |
66 |
Correct |
16 ms |
86620 KB |
Output is correct |
67 |
Correct |
17 ms |
86876 KB |
Output is correct |
68 |
Correct |
17 ms |
87020 KB |
Output is correct |
69 |
Correct |
19 ms |
87048 KB |
Output is correct |
70 |
Correct |
18 ms |
86876 KB |
Output is correct |
71 |
Correct |
17 ms |
86872 KB |
Output is correct |
72 |
Correct |
17 ms |
86872 KB |
Output is correct |
73 |
Correct |
16 ms |
86876 KB |
Output is correct |
74 |
Correct |
17 ms |
86804 KB |
Output is correct |
75 |
Correct |
17 ms |
86876 KB |
Output is correct |
76 |
Correct |
16 ms |
86620 KB |
Output is correct |
77 |
Correct |
17 ms |
87128 KB |
Output is correct |
78 |
Correct |
16 ms |
86872 KB |
Output is correct |
79 |
Correct |
18 ms |
86876 KB |
Output is correct |
80 |
Correct |
17 ms |
86896 KB |
Output is correct |
81 |
Correct |
17 ms |
86876 KB |
Output is correct |
82 |
Correct |
18 ms |
86876 KB |
Output is correct |
83 |
Correct |
17 ms |
86872 KB |
Output is correct |
84 |
Correct |
17 ms |
87064 KB |
Output is correct |
85 |
Correct |
17 ms |
86980 KB |
Output is correct |
86 |
Correct |
17 ms |
86876 KB |
Output is correct |
87 |
Correct |
16 ms |
86872 KB |
Output is correct |
88 |
Correct |
17 ms |
86876 KB |
Output is correct |
89 |
Correct |
16 ms |
86876 KB |
Output is correct |
90 |
Correct |
16 ms |
86876 KB |
Output is correct |
91 |
Correct |
17 ms |
86876 KB |
Output is correct |
92 |
Correct |
17 ms |
86876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
86872 KB |
Output is correct |
2 |
Correct |
16 ms |
86620 KB |
Output is correct |
3 |
Correct |
17 ms |
86804 KB |
Output is correct |
4 |
Correct |
17 ms |
86708 KB |
Output is correct |
5 |
Correct |
16 ms |
86620 KB |
Output is correct |
6 |
Correct |
16 ms |
86744 KB |
Output is correct |
7 |
Correct |
17 ms |
86620 KB |
Output is correct |
8 |
Correct |
17 ms |
86620 KB |
Output is correct |
9 |
Correct |
16 ms |
86616 KB |
Output is correct |
10 |
Correct |
17 ms |
86620 KB |
Output is correct |
11 |
Correct |
16 ms |
86620 KB |
Output is correct |
12 |
Correct |
17 ms |
87128 KB |
Output is correct |
13 |
Correct |
16 ms |
86620 KB |
Output is correct |
14 |
Correct |
16 ms |
86716 KB |
Output is correct |
15 |
Correct |
16 ms |
86616 KB |
Output is correct |
16 |
Correct |
17 ms |
86616 KB |
Output is correct |
17 |
Correct |
16 ms |
86620 KB |
Output is correct |
18 |
Correct |
16 ms |
86824 KB |
Output is correct |
19 |
Correct |
16 ms |
86620 KB |
Output is correct |
20 |
Correct |
16 ms |
86620 KB |
Output is correct |
21 |
Correct |
17 ms |
86620 KB |
Output is correct |
22 |
Correct |
16 ms |
86616 KB |
Output is correct |
23 |
Correct |
17 ms |
86876 KB |
Output is correct |
24 |
Correct |
16 ms |
86616 KB |
Output is correct |
25 |
Correct |
16 ms |
86620 KB |
Output is correct |
26 |
Correct |
16 ms |
86620 KB |
Output is correct |
27 |
Correct |
16 ms |
86620 KB |
Output is correct |
28 |
Correct |
16 ms |
86804 KB |
Output is correct |
29 |
Correct |
16 ms |
86620 KB |
Output is correct |
30 |
Correct |
16 ms |
86616 KB |
Output is correct |
31 |
Correct |
16 ms |
86616 KB |
Output is correct |
32 |
Correct |
16 ms |
86756 KB |
Output is correct |
33 |
Correct |
17 ms |
86756 KB |
Output is correct |
34 |
Correct |
16 ms |
86620 KB |
Output is correct |
35 |
Correct |
17 ms |
86620 KB |
Output is correct |
36 |
Correct |
16 ms |
86620 KB |
Output is correct |
37 |
Correct |
16 ms |
86620 KB |
Output is correct |
38 |
Correct |
16 ms |
86872 KB |
Output is correct |
39 |
Correct |
16 ms |
86844 KB |
Output is correct |
40 |
Correct |
16 ms |
86620 KB |
Output is correct |
41 |
Correct |
16 ms |
86620 KB |
Output is correct |
42 |
Correct |
17 ms |
86620 KB |
Output is correct |
43 |
Correct |
16 ms |
86684 KB |
Output is correct |
44 |
Correct |
16 ms |
86620 KB |
Output is correct |
45 |
Correct |
16 ms |
86796 KB |
Output is correct |
46 |
Correct |
16 ms |
86760 KB |
Output is correct |
47 |
Correct |
16 ms |
86620 KB |
Output is correct |
48 |
Correct |
16 ms |
86620 KB |
Output is correct |
49 |
Correct |
16 ms |
86620 KB |
Output is correct |
50 |
Correct |
16 ms |
86620 KB |
Output is correct |
51 |
Correct |
16 ms |
86620 KB |
Output is correct |
52 |
Correct |
16 ms |
86620 KB |
Output is correct |
53 |
Correct |
16 ms |
86748 KB |
Output is correct |
54 |
Correct |
17 ms |
86616 KB |
Output is correct |
55 |
Correct |
16 ms |
86620 KB |
Output is correct |
56 |
Correct |
17 ms |
86616 KB |
Output is correct |
57 |
Correct |
17 ms |
86620 KB |
Output is correct |
58 |
Correct |
16 ms |
86712 KB |
Output is correct |
59 |
Correct |
17 ms |
86616 KB |
Output is correct |
60 |
Correct |
16 ms |
86620 KB |
Output is correct |
61 |
Correct |
16 ms |
86620 KB |
Output is correct |
62 |
Correct |
17 ms |
86620 KB |
Output is correct |
63 |
Correct |
17 ms |
86620 KB |
Output is correct |
64 |
Correct |
16 ms |
86620 KB |
Output is correct |
65 |
Correct |
16 ms |
86768 KB |
Output is correct |
66 |
Correct |
109 ms |
112584 KB |
Output is correct |
67 |
Correct |
111 ms |
112584 KB |
Output is correct |
68 |
Correct |
140 ms |
121860 KB |
Output is correct |
69 |
Correct |
117 ms |
113896 KB |
Output is correct |
70 |
Correct |
138 ms |
113324 KB |
Output is correct |
71 |
Correct |
145 ms |
120784 KB |
Output is correct |
72 |
Correct |
158 ms |
120192 KB |
Output is correct |
73 |
Correct |
136 ms |
121032 KB |
Output is correct |
74 |
Correct |
141 ms |
117720 KB |
Output is correct |
75 |
Correct |
131 ms |
114900 KB |
Output is correct |
76 |
Correct |
91 ms |
105216 KB |
Output is correct |
77 |
Correct |
86 ms |
105260 KB |
Output is correct |
78 |
Correct |
78 ms |
103880 KB |
Output is correct |
79 |
Correct |
78 ms |
103508 KB |
Output is correct |
80 |
Correct |
63 ms |
100024 KB |
Output is correct |
81 |
Correct |
62 ms |
99924 KB |
Output is correct |
82 |
Correct |
18 ms |
87640 KB |
Output is correct |
83 |
Correct |
18 ms |
87640 KB |
Output is correct |
84 |
Correct |
18 ms |
87640 KB |
Output is correct |
85 |
Correct |
18 ms |
87644 KB |
Output is correct |
86 |
Correct |
19 ms |
87600 KB |
Output is correct |
87 |
Correct |
18 ms |
87640 KB |
Output is correct |
88 |
Correct |
16 ms |
87056 KB |
Output is correct |
89 |
Correct |
17 ms |
86864 KB |
Output is correct |
90 |
Correct |
18 ms |
86876 KB |
Output is correct |
91 |
Correct |
17 ms |
87132 KB |
Output is correct |
92 |
Correct |
17 ms |
87132 KB |
Output is correct |
93 |
Correct |
17 ms |
87016 KB |
Output is correct |
94 |
Correct |
18 ms |
87132 KB |
Output is correct |
95 |
Correct |
17 ms |
87132 KB |
Output is correct |
96 |
Correct |
17 ms |
87132 KB |
Output is correct |
97 |
Correct |
17 ms |
87132 KB |
Output is correct |
98 |
Correct |
18 ms |
87252 KB |
Output is correct |
99 |
Correct |
17 ms |
87128 KB |
Output is correct |
100 |
Correct |
18 ms |
87128 KB |
Output is correct |
101 |
Correct |
17 ms |
86872 KB |
Output is correct |
102 |
Correct |
17 ms |
86876 KB |
Output is correct |
103 |
Correct |
18 ms |
87128 KB |
Output is correct |
104 |
Correct |
18 ms |
86876 KB |
Output is correct |
105 |
Correct |
17 ms |
86876 KB |
Output is correct |
106 |
Correct |
18 ms |
87128 KB |
Output is correct |
107 |
Correct |
17 ms |
87132 KB |
Output is correct |
108 |
Correct |
149 ms |
120528 KB |
Output is correct |
109 |
Correct |
139 ms |
120528 KB |
Output is correct |
110 |
Correct |
167 ms |
120488 KB |
Output is correct |
111 |
Correct |
149 ms |
120600 KB |
Output is correct |
112 |
Correct |
165 ms |
120528 KB |
Output is correct |
113 |
Correct |
198 ms |
135632 KB |
Output is correct |
114 |
Correct |
186 ms |
130764 KB |
Output is correct |
115 |
Correct |
186 ms |
129788 KB |
Output is correct |
116 |
Correct |
158 ms |
126868 KB |
Output is correct |
117 |
Correct |
139 ms |
120528 KB |
Output is correct |
118 |
Correct |
163 ms |
120556 KB |
Output is correct |
119 |
Correct |
145 ms |
120696 KB |
Output is correct |
120 |
Correct |
142 ms |
120524 KB |
Output is correct |
121 |
Correct |
127 ms |
117708 KB |
Output is correct |
122 |
Correct |
117 ms |
114896 KB |
Output is correct |
123 |
Correct |
73 ms |
101752 KB |
Output is correct |
124 |
Correct |
128 ms |
117956 KB |
Output is correct |
125 |
Correct |
112 ms |
118204 KB |
Output is correct |
126 |
Correct |
114 ms |
118328 KB |
Output is correct |
127 |
Correct |
110 ms |
117924 KB |
Output is correct |
128 |
Correct |
18 ms |
87048 KB |
Output is correct |
129 |
Correct |
17 ms |
87132 KB |
Output is correct |
130 |
Correct |
17 ms |
86876 KB |
Output is correct |
131 |
Correct |
17 ms |
86876 KB |
Output is correct |
132 |
Correct |
16 ms |
86872 KB |
Output is correct |
133 |
Correct |
16 ms |
86876 KB |
Output is correct |
134 |
Correct |
17 ms |
86872 KB |
Output is correct |
135 |
Correct |
17 ms |
86876 KB |
Output is correct |
136 |
Correct |
17 ms |
86876 KB |
Output is correct |
137 |
Correct |
17 ms |
86876 KB |
Output is correct |
138 |
Correct |
17 ms |
86876 KB |
Output is correct |
139 |
Correct |
18 ms |
87008 KB |
Output is correct |
140 |
Correct |
17 ms |
87084 KB |
Output is correct |
141 |
Correct |
17 ms |
87132 KB |
Output is correct |
142 |
Correct |
17 ms |
87132 KB |
Output is correct |
143 |
Correct |
18 ms |
86872 KB |
Output is correct |
144 |
Correct |
17 ms |
86872 KB |
Output is correct |
145 |
Correct |
17 ms |
86876 KB |
Output is correct |
146 |
Correct |
17 ms |
86816 KB |
Output is correct |
147 |
Correct |
17 ms |
86872 KB |
Output is correct |
148 |
Correct |
17 ms |
86876 KB |
Output is correct |
149 |
Correct |
17 ms |
87016 KB |
Output is correct |
150 |
Correct |
17 ms |
86876 KB |
Output is correct |
151 |
Correct |
18 ms |
86860 KB |
Output is correct |
152 |
Correct |
18 ms |
86876 KB |
Output is correct |
153 |
Correct |
17 ms |
86620 KB |
Output is correct |
154 |
Correct |
17 ms |
86620 KB |
Output is correct |
155 |
Correct |
148 ms |
120504 KB |
Output is correct |
156 |
Correct |
167 ms |
120952 KB |
Output is correct |
157 |
Correct |
144 ms |
118748 KB |
Output is correct |
158 |
Correct |
135 ms |
113360 KB |
Output is correct |
159 |
Correct |
112 ms |
107396 KB |
Output is correct |
160 |
Correct |
107 ms |
105552 KB |
Output is correct |
161 |
Correct |
109 ms |
104468 KB |
Output is correct |
162 |
Correct |
103 ms |
103564 KB |
Output is correct |
163 |
Correct |
95 ms |
102996 KB |
Output is correct |
164 |
Correct |
95 ms |
102736 KB |
Output is correct |
165 |
Correct |
91 ms |
101972 KB |
Output is correct |
166 |
Correct |
93 ms |
101716 KB |
Output is correct |
167 |
Correct |
96 ms |
101800 KB |
Output is correct |
168 |
Correct |
96 ms |
104264 KB |
Output is correct |
169 |
Correct |
179 ms |
128972 KB |
Output is correct |
170 |
Correct |
171 ms |
125652 KB |
Output is correct |
171 |
Correct |
173 ms |
127588 KB |
Output is correct |
172 |
Correct |
159 ms |
122632 KB |
Output is correct |
173 |
Correct |
142 ms |
113296 KB |
Output is correct |
174 |
Correct |
144 ms |
113616 KB |
Output is correct |
175 |
Correct |
132 ms |
113360 KB |
Output is correct |
176 |
Correct |
112 ms |
108240 KB |
Output is correct |
177 |
Correct |
95 ms |
105048 KB |
Output is correct |
178 |
Correct |
150 ms |
116880 KB |
Output is correct |
179 |
Correct |
162 ms |
116524 KB |
Output is correct |
180 |
Correct |
132 ms |
114664 KB |
Output is correct |
181 |
Correct |
138 ms |
114512 KB |
Output is correct |
182 |
Correct |
16 ms |
86620 KB |
Output is correct |
183 |
Correct |
17 ms |
86876 KB |
Output is correct |
184 |
Correct |
17 ms |
87020 KB |
Output is correct |
185 |
Correct |
19 ms |
87048 KB |
Output is correct |
186 |
Correct |
18 ms |
86876 KB |
Output is correct |
187 |
Correct |
17 ms |
86872 KB |
Output is correct |
188 |
Correct |
17 ms |
86872 KB |
Output is correct |
189 |
Correct |
16 ms |
86876 KB |
Output is correct |
190 |
Correct |
17 ms |
86804 KB |
Output is correct |
191 |
Correct |
17 ms |
86876 KB |
Output is correct |
192 |
Correct |
16 ms |
86620 KB |
Output is correct |
193 |
Correct |
17 ms |
87128 KB |
Output is correct |
194 |
Correct |
16 ms |
86872 KB |
Output is correct |
195 |
Correct |
18 ms |
86876 KB |
Output is correct |
196 |
Correct |
17 ms |
86896 KB |
Output is correct |
197 |
Correct |
17 ms |
86876 KB |
Output is correct |
198 |
Correct |
18 ms |
86876 KB |
Output is correct |
199 |
Correct |
17 ms |
86872 KB |
Output is correct |
200 |
Correct |
17 ms |
87064 KB |
Output is correct |
201 |
Correct |
17 ms |
86980 KB |
Output is correct |
202 |
Correct |
17 ms |
86876 KB |
Output is correct |
203 |
Correct |
16 ms |
86872 KB |
Output is correct |
204 |
Correct |
17 ms |
86876 KB |
Output is correct |
205 |
Correct |
16 ms |
86876 KB |
Output is correct |
206 |
Correct |
16 ms |
86876 KB |
Output is correct |
207 |
Correct |
17 ms |
86876 KB |
Output is correct |
208 |
Correct |
17 ms |
86876 KB |
Output is correct |
209 |
Correct |
17 ms |
87388 KB |
Output is correct |
210 |
Correct |
76 ms |
101976 KB |
Output is correct |
211 |
Correct |
133 ms |
109100 KB |
Output is correct |
212 |
Correct |
160 ms |
111620 KB |
Output is correct |
213 |
Correct |
226 ms |
114212 KB |
Output is correct |
214 |
Correct |
69 ms |
105236 KB |
Output is correct |
215 |
Correct |
71 ms |
104276 KB |
Output is correct |
216 |
Correct |
143 ms |
112072 KB |
Output is correct |
217 |
Correct |
115 ms |
108112 KB |
Output is correct |
218 |
Correct |
116 ms |
104272 KB |
Output is correct |
219 |
Correct |
92 ms |
102484 KB |
Output is correct |
220 |
Correct |
88 ms |
102088 KB |
Output is correct |
221 |
Correct |
103 ms |
101480 KB |
Output is correct |
222 |
Correct |
94 ms |
102992 KB |
Output is correct |
223 |
Correct |
127 ms |
113616 KB |
Output is correct |
224 |
Correct |
133 ms |
113232 KB |
Output is correct |
225 |
Correct |
113 ms |
107092 KB |
Output is correct |
226 |
Correct |
110 ms |
107240 KB |
Output is correct |
227 |
Correct |
112 ms |
107272 KB |
Output is correct |
228 |
Correct |
107 ms |
105160 KB |
Output is correct |
229 |
Correct |
89 ms |
102672 KB |
Output is correct |
230 |
Correct |
109 ms |
108036 KB |
Output is correct |
231 |
Correct |
118 ms |
107980 KB |
Output is correct |