#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
typedef long long ll;
#define USING_ORDERED_SET 0
#if USING_ORDERED_SET
#include<bits/extc++.h>
using namespace __gnu_pbds;
template<class T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#endif
template<class T>void umax(T &a,T b){if(a<b)a=b;}
template<class T>void umin(T &a,T b){if(b<a)a=b;}
#ifdef IOI2021SG
#define printl(args...)printf(args)
#else
#define printl(args...)((void)0)
#endif
#define MAXN 400009
#define ll long long
#define pb(x) push_back(x)
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
class Articulation {
public:
std::vector<int> keyV, bcc[MAXN];
int cnt;
int gao(int n, const std::vector<int> e[]) {
memset(tag, use = 0, sizeof(tag[0]) * n);
memset(low, cnt = 0, sizeof(low[0]) * n);
std::fill_n(bcc, n, keyV = std::vector<int>());
for (int i = 0; i < n; ++i) if (!tag[i]) dfs(i, 1, e);
return cnt;
}
private:
int tag[MAXN], low[MAXN], dot[MAXN], use;
void dfs(int x, int dep, const std::vector<int> e[]) {
int src = 0, out = 1 < dep; dot[use++] = x;
tag[x] = low[x] = dep;
for (auto &y: e[x]) {
if (!tag[y]) {
dfs(y, dep + 1, e);
low[x] = std::min(low[x], low[y]);
if (low[y] >= tag[x]) {
if (++out == 2) keyV.push_back(x);
while (dot[--use] != y) bcc[dot[use]].push_back(cnt);
bcc[x].push_back(cnt); bcc[y].push_back(cnt++);
}
} else if (tag[y] != tag[x] - 1 || src++) {
low[x] = std::min(low[x], tag[y]);
}
}
}
} bcc;
vector<int> G[MAXN];
//APIO 2018 Duathlon
/*
Articulation based BCC(Biconnected Component)
*/
vector<int>adj[MAXN];
void add(int u,int v){
adj[u].pb(v);
adj[v].pb(u);
}
int vis[MAXN],sub[MAXN],n,m;
int comp_sz[MAXN];
void dfs(int nd,int pr){
sub[nd]=(nd<n);
vis[nd]=1;
for(auto to:adj[nd])
if(to!=pr)
dfs(to,nd),sub[nd]+=sub[to];
}
ll C2(int x){
return (x*1LL*(x-1));
}
ll C3(int x){
return (C2(x)*1LL*(x-2));
}
ll ans=0;
void dfs1(int nd,int pr,int root){
if(nd<n){
for(auto to:adj[nd]){
if(to!=pr){
ans-=(comp_sz[to]-1)*1LL*C2(sub[root]-sub[to]);
dfs1(to,nd,root);
}
else{
ans-=(comp_sz[to]-1)*1LL*C2(sub[nd]);
}
}
}
else{
for(auto to:adj[nd])
if(to!=pr)
dfs1(to,nd,root);
}
}
int main(){
scanf("%d%d",&n,&m);
for(int i=0;i<m;i++){
int u,v;
scanf("%d%d",&u,&v);
u--;v--;
G[u].pb(v);G[v].pb(u);
}
int C = bcc.gao(n,G);
for(int i=0;i<n;i++)
for(auto to:bcc.bcc[i]){
add(i, to+n);
comp_sz[to+n]++;
}
vector<int>roots;
for(int i=n;i<n+C;i++)
if(!vis[i]){
roots.pb(i);
dfs(i,-1);
}
for(auto root:roots){
ans+=C3(sub[root]);
dfs1(root,-1,root);
}
printf("%lld\n",ans);
}
Compilation message
count_triplets.cpp: In function 'void usaco(std::string)':
count_triplets.cpp:5:29: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
count_triplets.cpp:5:66: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:101:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
101 | scanf("%d%d",&n,&m);
| ~~~~~^~~~~~~~~~~~~~
count_triplets.cpp:104:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
104 | scanf("%d%d",&u,&v);
| ~~~~~^~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
28492 KB |
Output is correct |
2 |
Correct |
16 ms |
28416 KB |
Output is correct |
3 |
Correct |
18 ms |
28456 KB |
Output is correct |
4 |
Correct |
17 ms |
28476 KB |
Output is correct |
5 |
Correct |
16 ms |
28512 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28452 KB |
Output is correct |
9 |
Correct |
18 ms |
28492 KB |
Output is correct |
10 |
Correct |
16 ms |
28452 KB |
Output is correct |
11 |
Correct |
16 ms |
28492 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
16 ms |
28484 KB |
Output is correct |
14 |
Correct |
16 ms |
28484 KB |
Output is correct |
15 |
Correct |
16 ms |
28468 KB |
Output is correct |
16 |
Correct |
16 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28460 KB |
Output is correct |
19 |
Correct |
15 ms |
28524 KB |
Output is correct |
20 |
Correct |
16 ms |
28484 KB |
Output is correct |
21 |
Correct |
16 ms |
28492 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28488 KB |
Output is correct |
24 |
Correct |
16 ms |
28492 KB |
Output is correct |
25 |
Correct |
18 ms |
28448 KB |
Output is correct |
26 |
Correct |
19 ms |
28444 KB |
Output is correct |
27 |
Correct |
19 ms |
28432 KB |
Output is correct |
28 |
Correct |
17 ms |
28532 KB |
Output is correct |
29 |
Correct |
19 ms |
28428 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
15 ms |
28480 KB |
Output is correct |
32 |
Correct |
16 ms |
28492 KB |
Output is correct |
33 |
Correct |
17 ms |
28480 KB |
Output is correct |
34 |
Correct |
16 ms |
28484 KB |
Output is correct |
35 |
Correct |
19 ms |
28424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
28492 KB |
Output is correct |
2 |
Correct |
16 ms |
28416 KB |
Output is correct |
3 |
Correct |
18 ms |
28456 KB |
Output is correct |
4 |
Correct |
17 ms |
28476 KB |
Output is correct |
5 |
Correct |
16 ms |
28512 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28452 KB |
Output is correct |
9 |
Correct |
18 ms |
28492 KB |
Output is correct |
10 |
Correct |
16 ms |
28452 KB |
Output is correct |
11 |
Correct |
16 ms |
28492 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
16 ms |
28484 KB |
Output is correct |
14 |
Correct |
16 ms |
28484 KB |
Output is correct |
15 |
Correct |
16 ms |
28468 KB |
Output is correct |
16 |
Correct |
16 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28460 KB |
Output is correct |
19 |
Correct |
15 ms |
28524 KB |
Output is correct |
20 |
Correct |
16 ms |
28484 KB |
Output is correct |
21 |
Correct |
16 ms |
28492 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28488 KB |
Output is correct |
24 |
Correct |
16 ms |
28492 KB |
Output is correct |
25 |
Correct |
18 ms |
28448 KB |
Output is correct |
26 |
Correct |
19 ms |
28444 KB |
Output is correct |
27 |
Correct |
19 ms |
28432 KB |
Output is correct |
28 |
Correct |
17 ms |
28532 KB |
Output is correct |
29 |
Correct |
19 ms |
28428 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
15 ms |
28480 KB |
Output is correct |
32 |
Correct |
16 ms |
28492 KB |
Output is correct |
33 |
Correct |
17 ms |
28480 KB |
Output is correct |
34 |
Correct |
16 ms |
28484 KB |
Output is correct |
35 |
Correct |
19 ms |
28424 KB |
Output is correct |
36 |
Correct |
16 ms |
28444 KB |
Output is correct |
37 |
Correct |
18 ms |
28480 KB |
Output is correct |
38 |
Correct |
16 ms |
28484 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28500 KB |
Output is correct |
41 |
Correct |
16 ms |
28480 KB |
Output is correct |
42 |
Correct |
16 ms |
28452 KB |
Output is correct |
43 |
Correct |
16 ms |
28484 KB |
Output is correct |
44 |
Correct |
17 ms |
28492 KB |
Output is correct |
45 |
Correct |
18 ms |
28524 KB |
Output is correct |
46 |
Correct |
17 ms |
28492 KB |
Output is correct |
47 |
Correct |
18 ms |
28492 KB |
Output is correct |
48 |
Correct |
19 ms |
28468 KB |
Output is correct |
49 |
Correct |
17 ms |
28492 KB |
Output is correct |
50 |
Correct |
16 ms |
28488 KB |
Output is correct |
51 |
Correct |
16 ms |
28468 KB |
Output is correct |
52 |
Correct |
17 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28524 KB |
Output is correct |
54 |
Correct |
17 ms |
28496 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28468 KB |
Output is correct |
57 |
Correct |
16 ms |
28480 KB |
Output is correct |
58 |
Correct |
16 ms |
28436 KB |
Output is correct |
59 |
Correct |
17 ms |
28480 KB |
Output is correct |
60 |
Correct |
17 ms |
28492 KB |
Output is correct |
61 |
Correct |
18 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28492 KB |
Output is correct |
63 |
Correct |
17 ms |
28460 KB |
Output is correct |
64 |
Correct |
17 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
115 ms |
50880 KB |
Output is correct |
2 |
Correct |
113 ms |
50864 KB |
Output is correct |
3 |
Correct |
148 ms |
51276 KB |
Output is correct |
4 |
Correct |
147 ms |
49472 KB |
Output is correct |
5 |
Correct |
134 ms |
47936 KB |
Output is correct |
6 |
Correct |
159 ms |
52292 KB |
Output is correct |
7 |
Correct |
179 ms |
46908 KB |
Output is correct |
8 |
Correct |
179 ms |
49384 KB |
Output is correct |
9 |
Correct |
179 ms |
45392 KB |
Output is correct |
10 |
Correct |
159 ms |
45984 KB |
Output is correct |
11 |
Correct |
145 ms |
42944 KB |
Output is correct |
12 |
Correct |
148 ms |
42676 KB |
Output is correct |
13 |
Correct |
135 ms |
42572 KB |
Output is correct |
14 |
Correct |
129 ms |
42048 KB |
Output is correct |
15 |
Correct |
109 ms |
40568 KB |
Output is correct |
16 |
Correct |
108 ms |
40268 KB |
Output is correct |
17 |
Correct |
19 ms |
30412 KB |
Output is correct |
18 |
Correct |
21 ms |
30500 KB |
Output is correct |
19 |
Correct |
19 ms |
30404 KB |
Output is correct |
20 |
Correct |
21 ms |
30404 KB |
Output is correct |
21 |
Correct |
20 ms |
30336 KB |
Output is correct |
22 |
Correct |
19 ms |
30340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
28616 KB |
Output is correct |
2 |
Correct |
17 ms |
28676 KB |
Output is correct |
3 |
Correct |
17 ms |
28616 KB |
Output is correct |
4 |
Correct |
17 ms |
28748 KB |
Output is correct |
5 |
Correct |
18 ms |
28744 KB |
Output is correct |
6 |
Correct |
17 ms |
28648 KB |
Output is correct |
7 |
Correct |
18 ms |
28784 KB |
Output is correct |
8 |
Correct |
18 ms |
28620 KB |
Output is correct |
9 |
Correct |
18 ms |
28620 KB |
Output is correct |
10 |
Correct |
17 ms |
28632 KB |
Output is correct |
11 |
Correct |
18 ms |
28620 KB |
Output is correct |
12 |
Correct |
20 ms |
28644 KB |
Output is correct |
13 |
Correct |
18 ms |
28620 KB |
Output is correct |
14 |
Correct |
17 ms |
28616 KB |
Output is correct |
15 |
Correct |
17 ms |
28584 KB |
Output is correct |
16 |
Correct |
17 ms |
28616 KB |
Output is correct |
17 |
Correct |
17 ms |
28620 KB |
Output is correct |
18 |
Correct |
17 ms |
28668 KB |
Output is correct |
19 |
Correct |
17 ms |
28616 KB |
Output is correct |
20 |
Correct |
17 ms |
28620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
198 ms |
45464 KB |
Output is correct |
2 |
Correct |
175 ms |
45472 KB |
Output is correct |
3 |
Correct |
198 ms |
45508 KB |
Output is correct |
4 |
Correct |
199 ms |
45564 KB |
Output is correct |
5 |
Correct |
198 ms |
45528 KB |
Output is correct |
6 |
Correct |
198 ms |
61336 KB |
Output is correct |
7 |
Correct |
232 ms |
51136 KB |
Output is correct |
8 |
Correct |
191 ms |
49592 KB |
Output is correct |
9 |
Correct |
189 ms |
48108 KB |
Output is correct |
10 |
Correct |
206 ms |
45592 KB |
Output is correct |
11 |
Correct |
169 ms |
45516 KB |
Output is correct |
12 |
Correct |
185 ms |
45448 KB |
Output is correct |
13 |
Correct |
192 ms |
45508 KB |
Output is correct |
14 |
Correct |
173 ms |
44804 KB |
Output is correct |
15 |
Correct |
160 ms |
43852 KB |
Output is correct |
16 |
Correct |
102 ms |
40392 KB |
Output is correct |
17 |
Correct |
135 ms |
46088 KB |
Output is correct |
18 |
Correct |
152 ms |
46132 KB |
Output is correct |
19 |
Correct |
149 ms |
46080 KB |
Output is correct |
20 |
Correct |
143 ms |
46144 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
28620 KB |
Output is correct |
2 |
Correct |
17 ms |
28568 KB |
Output is correct |
3 |
Correct |
17 ms |
28608 KB |
Output is correct |
4 |
Correct |
18 ms |
28612 KB |
Output is correct |
5 |
Correct |
18 ms |
28620 KB |
Output is correct |
6 |
Correct |
18 ms |
28620 KB |
Output is correct |
7 |
Correct |
18 ms |
28580 KB |
Output is correct |
8 |
Correct |
18 ms |
28616 KB |
Output is correct |
9 |
Correct |
17 ms |
28620 KB |
Output is correct |
10 |
Correct |
17 ms |
28540 KB |
Output is correct |
11 |
Correct |
16 ms |
28644 KB |
Output is correct |
12 |
Correct |
18 ms |
28664 KB |
Output is correct |
13 |
Correct |
18 ms |
28708 KB |
Output is correct |
14 |
Correct |
18 ms |
28620 KB |
Output is correct |
15 |
Correct |
17 ms |
28620 KB |
Output is correct |
16 |
Correct |
17 ms |
28576 KB |
Output is correct |
17 |
Correct |
17 ms |
28620 KB |
Output is correct |
18 |
Correct |
17 ms |
28660 KB |
Output is correct |
19 |
Correct |
18 ms |
28628 KB |
Output is correct |
20 |
Correct |
17 ms |
28592 KB |
Output is correct |
21 |
Correct |
18 ms |
28616 KB |
Output is correct |
22 |
Correct |
20 ms |
28648 KB |
Output is correct |
23 |
Correct |
17 ms |
28620 KB |
Output is correct |
24 |
Correct |
19 ms |
28620 KB |
Output is correct |
25 |
Correct |
16 ms |
28528 KB |
Output is correct |
26 |
Correct |
18 ms |
28512 KB |
Output is correct |
27 |
Correct |
16 ms |
28492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
216 ms |
45476 KB |
Output is correct |
2 |
Correct |
180 ms |
45396 KB |
Output is correct |
3 |
Correct |
232 ms |
44788 KB |
Output is correct |
4 |
Correct |
184 ms |
43960 KB |
Output is correct |
5 |
Correct |
151 ms |
42724 KB |
Output is correct |
6 |
Correct |
135 ms |
42304 KB |
Output is correct |
7 |
Correct |
162 ms |
42168 KB |
Output is correct |
8 |
Correct |
145 ms |
41848 KB |
Output is correct |
9 |
Correct |
157 ms |
41736 KB |
Output is correct |
10 |
Correct |
118 ms |
41596 KB |
Output is correct |
11 |
Correct |
124 ms |
41492 KB |
Output is correct |
12 |
Correct |
122 ms |
41548 KB |
Output is correct |
13 |
Correct |
111 ms |
41564 KB |
Output is correct |
14 |
Correct |
134 ms |
43756 KB |
Output is correct |
15 |
Correct |
201 ms |
50816 KB |
Output is correct |
16 |
Correct |
198 ms |
48704 KB |
Output is correct |
17 |
Correct |
215 ms |
49344 KB |
Output is correct |
18 |
Correct |
206 ms |
47604 KB |
Output is correct |
19 |
Correct |
164 ms |
43932 KB |
Output is correct |
20 |
Correct |
200 ms |
43784 KB |
Output is correct |
21 |
Correct |
183 ms |
43872 KB |
Output is correct |
22 |
Correct |
173 ms |
43288 KB |
Output is correct |
23 |
Correct |
130 ms |
42676 KB |
Output is correct |
24 |
Correct |
153 ms |
45232 KB |
Output is correct |
25 |
Correct |
181 ms |
45216 KB |
Output is correct |
26 |
Correct |
190 ms |
44480 KB |
Output is correct |
27 |
Correct |
200 ms |
44604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
28492 KB |
Output is correct |
2 |
Correct |
16 ms |
28416 KB |
Output is correct |
3 |
Correct |
18 ms |
28456 KB |
Output is correct |
4 |
Correct |
17 ms |
28476 KB |
Output is correct |
5 |
Correct |
16 ms |
28512 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28452 KB |
Output is correct |
9 |
Correct |
18 ms |
28492 KB |
Output is correct |
10 |
Correct |
16 ms |
28452 KB |
Output is correct |
11 |
Correct |
16 ms |
28492 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
16 ms |
28484 KB |
Output is correct |
14 |
Correct |
16 ms |
28484 KB |
Output is correct |
15 |
Correct |
16 ms |
28468 KB |
Output is correct |
16 |
Correct |
16 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28460 KB |
Output is correct |
19 |
Correct |
15 ms |
28524 KB |
Output is correct |
20 |
Correct |
16 ms |
28484 KB |
Output is correct |
21 |
Correct |
16 ms |
28492 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28488 KB |
Output is correct |
24 |
Correct |
16 ms |
28492 KB |
Output is correct |
25 |
Correct |
18 ms |
28448 KB |
Output is correct |
26 |
Correct |
19 ms |
28444 KB |
Output is correct |
27 |
Correct |
19 ms |
28432 KB |
Output is correct |
28 |
Correct |
17 ms |
28532 KB |
Output is correct |
29 |
Correct |
19 ms |
28428 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
15 ms |
28480 KB |
Output is correct |
32 |
Correct |
16 ms |
28492 KB |
Output is correct |
33 |
Correct |
17 ms |
28480 KB |
Output is correct |
34 |
Correct |
16 ms |
28484 KB |
Output is correct |
35 |
Correct |
19 ms |
28424 KB |
Output is correct |
36 |
Correct |
16 ms |
28444 KB |
Output is correct |
37 |
Correct |
18 ms |
28480 KB |
Output is correct |
38 |
Correct |
16 ms |
28484 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28500 KB |
Output is correct |
41 |
Correct |
16 ms |
28480 KB |
Output is correct |
42 |
Correct |
16 ms |
28452 KB |
Output is correct |
43 |
Correct |
16 ms |
28484 KB |
Output is correct |
44 |
Correct |
17 ms |
28492 KB |
Output is correct |
45 |
Correct |
18 ms |
28524 KB |
Output is correct |
46 |
Correct |
17 ms |
28492 KB |
Output is correct |
47 |
Correct |
18 ms |
28492 KB |
Output is correct |
48 |
Correct |
19 ms |
28468 KB |
Output is correct |
49 |
Correct |
17 ms |
28492 KB |
Output is correct |
50 |
Correct |
16 ms |
28488 KB |
Output is correct |
51 |
Correct |
16 ms |
28468 KB |
Output is correct |
52 |
Correct |
17 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28524 KB |
Output is correct |
54 |
Correct |
17 ms |
28496 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28468 KB |
Output is correct |
57 |
Correct |
16 ms |
28480 KB |
Output is correct |
58 |
Correct |
16 ms |
28436 KB |
Output is correct |
59 |
Correct |
17 ms |
28480 KB |
Output is correct |
60 |
Correct |
17 ms |
28492 KB |
Output is correct |
61 |
Correct |
18 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28492 KB |
Output is correct |
63 |
Correct |
17 ms |
28460 KB |
Output is correct |
64 |
Correct |
17 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28404 KB |
Output is correct |
66 |
Correct |
16 ms |
28456 KB |
Output is correct |
67 |
Correct |
18 ms |
28620 KB |
Output is correct |
68 |
Correct |
19 ms |
28736 KB |
Output is correct |
69 |
Correct |
19 ms |
28624 KB |
Output is correct |
70 |
Correct |
20 ms |
28620 KB |
Output is correct |
71 |
Correct |
18 ms |
28612 KB |
Output is correct |
72 |
Correct |
19 ms |
28620 KB |
Output is correct |
73 |
Correct |
18 ms |
28600 KB |
Output is correct |
74 |
Correct |
20 ms |
28668 KB |
Output is correct |
75 |
Correct |
20 ms |
28548 KB |
Output is correct |
76 |
Correct |
18 ms |
28476 KB |
Output is correct |
77 |
Correct |
19 ms |
28572 KB |
Output is correct |
78 |
Correct |
18 ms |
28656 KB |
Output is correct |
79 |
Correct |
19 ms |
28572 KB |
Output is correct |
80 |
Correct |
20 ms |
28656 KB |
Output is correct |
81 |
Correct |
20 ms |
28600 KB |
Output is correct |
82 |
Correct |
17 ms |
28684 KB |
Output is correct |
83 |
Correct |
18 ms |
28612 KB |
Output is correct |
84 |
Correct |
17 ms |
28620 KB |
Output is correct |
85 |
Correct |
16 ms |
28620 KB |
Output is correct |
86 |
Correct |
20 ms |
28616 KB |
Output is correct |
87 |
Correct |
22 ms |
28544 KB |
Output is correct |
88 |
Correct |
18 ms |
28548 KB |
Output is correct |
89 |
Correct |
21 ms |
28584 KB |
Output is correct |
90 |
Correct |
20 ms |
28540 KB |
Output is correct |
91 |
Correct |
18 ms |
28620 KB |
Output is correct |
92 |
Correct |
19 ms |
28620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
28492 KB |
Output is correct |
2 |
Correct |
16 ms |
28416 KB |
Output is correct |
3 |
Correct |
18 ms |
28456 KB |
Output is correct |
4 |
Correct |
17 ms |
28476 KB |
Output is correct |
5 |
Correct |
16 ms |
28512 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28452 KB |
Output is correct |
9 |
Correct |
18 ms |
28492 KB |
Output is correct |
10 |
Correct |
16 ms |
28452 KB |
Output is correct |
11 |
Correct |
16 ms |
28492 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
16 ms |
28484 KB |
Output is correct |
14 |
Correct |
16 ms |
28484 KB |
Output is correct |
15 |
Correct |
16 ms |
28468 KB |
Output is correct |
16 |
Correct |
16 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28460 KB |
Output is correct |
19 |
Correct |
15 ms |
28524 KB |
Output is correct |
20 |
Correct |
16 ms |
28484 KB |
Output is correct |
21 |
Correct |
16 ms |
28492 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28488 KB |
Output is correct |
24 |
Correct |
16 ms |
28492 KB |
Output is correct |
25 |
Correct |
18 ms |
28448 KB |
Output is correct |
26 |
Correct |
19 ms |
28444 KB |
Output is correct |
27 |
Correct |
19 ms |
28432 KB |
Output is correct |
28 |
Correct |
17 ms |
28532 KB |
Output is correct |
29 |
Correct |
19 ms |
28428 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
15 ms |
28480 KB |
Output is correct |
32 |
Correct |
16 ms |
28492 KB |
Output is correct |
33 |
Correct |
17 ms |
28480 KB |
Output is correct |
34 |
Correct |
16 ms |
28484 KB |
Output is correct |
35 |
Correct |
19 ms |
28424 KB |
Output is correct |
36 |
Correct |
16 ms |
28444 KB |
Output is correct |
37 |
Correct |
18 ms |
28480 KB |
Output is correct |
38 |
Correct |
16 ms |
28484 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28500 KB |
Output is correct |
41 |
Correct |
16 ms |
28480 KB |
Output is correct |
42 |
Correct |
16 ms |
28452 KB |
Output is correct |
43 |
Correct |
16 ms |
28484 KB |
Output is correct |
44 |
Correct |
17 ms |
28492 KB |
Output is correct |
45 |
Correct |
18 ms |
28524 KB |
Output is correct |
46 |
Correct |
17 ms |
28492 KB |
Output is correct |
47 |
Correct |
18 ms |
28492 KB |
Output is correct |
48 |
Correct |
19 ms |
28468 KB |
Output is correct |
49 |
Correct |
17 ms |
28492 KB |
Output is correct |
50 |
Correct |
16 ms |
28488 KB |
Output is correct |
51 |
Correct |
16 ms |
28468 KB |
Output is correct |
52 |
Correct |
17 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28524 KB |
Output is correct |
54 |
Correct |
17 ms |
28496 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28468 KB |
Output is correct |
57 |
Correct |
16 ms |
28480 KB |
Output is correct |
58 |
Correct |
16 ms |
28436 KB |
Output is correct |
59 |
Correct |
17 ms |
28480 KB |
Output is correct |
60 |
Correct |
17 ms |
28492 KB |
Output is correct |
61 |
Correct |
18 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28492 KB |
Output is correct |
63 |
Correct |
17 ms |
28460 KB |
Output is correct |
64 |
Correct |
17 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28404 KB |
Output is correct |
66 |
Correct |
115 ms |
50880 KB |
Output is correct |
67 |
Correct |
113 ms |
50864 KB |
Output is correct |
68 |
Correct |
148 ms |
51276 KB |
Output is correct |
69 |
Correct |
147 ms |
49472 KB |
Output is correct |
70 |
Correct |
134 ms |
47936 KB |
Output is correct |
71 |
Correct |
159 ms |
52292 KB |
Output is correct |
72 |
Correct |
179 ms |
46908 KB |
Output is correct |
73 |
Correct |
179 ms |
49384 KB |
Output is correct |
74 |
Correct |
179 ms |
45392 KB |
Output is correct |
75 |
Correct |
159 ms |
45984 KB |
Output is correct |
76 |
Correct |
145 ms |
42944 KB |
Output is correct |
77 |
Correct |
148 ms |
42676 KB |
Output is correct |
78 |
Correct |
135 ms |
42572 KB |
Output is correct |
79 |
Correct |
129 ms |
42048 KB |
Output is correct |
80 |
Correct |
109 ms |
40568 KB |
Output is correct |
81 |
Correct |
108 ms |
40268 KB |
Output is correct |
82 |
Correct |
19 ms |
30412 KB |
Output is correct |
83 |
Correct |
21 ms |
30500 KB |
Output is correct |
84 |
Correct |
19 ms |
30404 KB |
Output is correct |
85 |
Correct |
21 ms |
30404 KB |
Output is correct |
86 |
Correct |
20 ms |
30336 KB |
Output is correct |
87 |
Correct |
19 ms |
30340 KB |
Output is correct |
88 |
Correct |
17 ms |
28616 KB |
Output is correct |
89 |
Correct |
17 ms |
28676 KB |
Output is correct |
90 |
Correct |
17 ms |
28616 KB |
Output is correct |
91 |
Correct |
17 ms |
28748 KB |
Output is correct |
92 |
Correct |
18 ms |
28744 KB |
Output is correct |
93 |
Correct |
17 ms |
28648 KB |
Output is correct |
94 |
Correct |
18 ms |
28784 KB |
Output is correct |
95 |
Correct |
18 ms |
28620 KB |
Output is correct |
96 |
Correct |
18 ms |
28620 KB |
Output is correct |
97 |
Correct |
17 ms |
28632 KB |
Output is correct |
98 |
Correct |
18 ms |
28620 KB |
Output is correct |
99 |
Correct |
20 ms |
28644 KB |
Output is correct |
100 |
Correct |
18 ms |
28620 KB |
Output is correct |
101 |
Correct |
17 ms |
28616 KB |
Output is correct |
102 |
Correct |
17 ms |
28584 KB |
Output is correct |
103 |
Correct |
17 ms |
28616 KB |
Output is correct |
104 |
Correct |
17 ms |
28620 KB |
Output is correct |
105 |
Correct |
17 ms |
28668 KB |
Output is correct |
106 |
Correct |
17 ms |
28616 KB |
Output is correct |
107 |
Correct |
17 ms |
28620 KB |
Output is correct |
108 |
Correct |
198 ms |
45464 KB |
Output is correct |
109 |
Correct |
175 ms |
45472 KB |
Output is correct |
110 |
Correct |
198 ms |
45508 KB |
Output is correct |
111 |
Correct |
199 ms |
45564 KB |
Output is correct |
112 |
Correct |
198 ms |
45528 KB |
Output is correct |
113 |
Correct |
198 ms |
61336 KB |
Output is correct |
114 |
Correct |
232 ms |
51136 KB |
Output is correct |
115 |
Correct |
191 ms |
49592 KB |
Output is correct |
116 |
Correct |
189 ms |
48108 KB |
Output is correct |
117 |
Correct |
206 ms |
45592 KB |
Output is correct |
118 |
Correct |
169 ms |
45516 KB |
Output is correct |
119 |
Correct |
185 ms |
45448 KB |
Output is correct |
120 |
Correct |
192 ms |
45508 KB |
Output is correct |
121 |
Correct |
173 ms |
44804 KB |
Output is correct |
122 |
Correct |
160 ms |
43852 KB |
Output is correct |
123 |
Correct |
102 ms |
40392 KB |
Output is correct |
124 |
Correct |
135 ms |
46088 KB |
Output is correct |
125 |
Correct |
152 ms |
46132 KB |
Output is correct |
126 |
Correct |
149 ms |
46080 KB |
Output is correct |
127 |
Correct |
143 ms |
46144 KB |
Output is correct |
128 |
Correct |
18 ms |
28620 KB |
Output is correct |
129 |
Correct |
17 ms |
28568 KB |
Output is correct |
130 |
Correct |
17 ms |
28608 KB |
Output is correct |
131 |
Correct |
18 ms |
28612 KB |
Output is correct |
132 |
Correct |
18 ms |
28620 KB |
Output is correct |
133 |
Correct |
18 ms |
28620 KB |
Output is correct |
134 |
Correct |
18 ms |
28580 KB |
Output is correct |
135 |
Correct |
18 ms |
28616 KB |
Output is correct |
136 |
Correct |
17 ms |
28620 KB |
Output is correct |
137 |
Correct |
17 ms |
28540 KB |
Output is correct |
138 |
Correct |
16 ms |
28644 KB |
Output is correct |
139 |
Correct |
18 ms |
28664 KB |
Output is correct |
140 |
Correct |
18 ms |
28708 KB |
Output is correct |
141 |
Correct |
18 ms |
28620 KB |
Output is correct |
142 |
Correct |
17 ms |
28620 KB |
Output is correct |
143 |
Correct |
17 ms |
28576 KB |
Output is correct |
144 |
Correct |
17 ms |
28620 KB |
Output is correct |
145 |
Correct |
17 ms |
28660 KB |
Output is correct |
146 |
Correct |
18 ms |
28628 KB |
Output is correct |
147 |
Correct |
17 ms |
28592 KB |
Output is correct |
148 |
Correct |
18 ms |
28616 KB |
Output is correct |
149 |
Correct |
20 ms |
28648 KB |
Output is correct |
150 |
Correct |
17 ms |
28620 KB |
Output is correct |
151 |
Correct |
19 ms |
28620 KB |
Output is correct |
152 |
Correct |
16 ms |
28528 KB |
Output is correct |
153 |
Correct |
18 ms |
28512 KB |
Output is correct |
154 |
Correct |
16 ms |
28492 KB |
Output is correct |
155 |
Correct |
216 ms |
45476 KB |
Output is correct |
156 |
Correct |
180 ms |
45396 KB |
Output is correct |
157 |
Correct |
232 ms |
44788 KB |
Output is correct |
158 |
Correct |
184 ms |
43960 KB |
Output is correct |
159 |
Correct |
151 ms |
42724 KB |
Output is correct |
160 |
Correct |
135 ms |
42304 KB |
Output is correct |
161 |
Correct |
162 ms |
42168 KB |
Output is correct |
162 |
Correct |
145 ms |
41848 KB |
Output is correct |
163 |
Correct |
157 ms |
41736 KB |
Output is correct |
164 |
Correct |
118 ms |
41596 KB |
Output is correct |
165 |
Correct |
124 ms |
41492 KB |
Output is correct |
166 |
Correct |
122 ms |
41548 KB |
Output is correct |
167 |
Correct |
111 ms |
41564 KB |
Output is correct |
168 |
Correct |
134 ms |
43756 KB |
Output is correct |
169 |
Correct |
201 ms |
50816 KB |
Output is correct |
170 |
Correct |
198 ms |
48704 KB |
Output is correct |
171 |
Correct |
215 ms |
49344 KB |
Output is correct |
172 |
Correct |
206 ms |
47604 KB |
Output is correct |
173 |
Correct |
164 ms |
43932 KB |
Output is correct |
174 |
Correct |
200 ms |
43784 KB |
Output is correct |
175 |
Correct |
183 ms |
43872 KB |
Output is correct |
176 |
Correct |
173 ms |
43288 KB |
Output is correct |
177 |
Correct |
130 ms |
42676 KB |
Output is correct |
178 |
Correct |
153 ms |
45232 KB |
Output is correct |
179 |
Correct |
181 ms |
45216 KB |
Output is correct |
180 |
Correct |
190 ms |
44480 KB |
Output is correct |
181 |
Correct |
200 ms |
44604 KB |
Output is correct |
182 |
Correct |
16 ms |
28456 KB |
Output is correct |
183 |
Correct |
18 ms |
28620 KB |
Output is correct |
184 |
Correct |
19 ms |
28736 KB |
Output is correct |
185 |
Correct |
19 ms |
28624 KB |
Output is correct |
186 |
Correct |
20 ms |
28620 KB |
Output is correct |
187 |
Correct |
18 ms |
28612 KB |
Output is correct |
188 |
Correct |
19 ms |
28620 KB |
Output is correct |
189 |
Correct |
18 ms |
28600 KB |
Output is correct |
190 |
Correct |
20 ms |
28668 KB |
Output is correct |
191 |
Correct |
20 ms |
28548 KB |
Output is correct |
192 |
Correct |
18 ms |
28476 KB |
Output is correct |
193 |
Correct |
19 ms |
28572 KB |
Output is correct |
194 |
Correct |
18 ms |
28656 KB |
Output is correct |
195 |
Correct |
19 ms |
28572 KB |
Output is correct |
196 |
Correct |
20 ms |
28656 KB |
Output is correct |
197 |
Correct |
20 ms |
28600 KB |
Output is correct |
198 |
Correct |
17 ms |
28684 KB |
Output is correct |
199 |
Correct |
18 ms |
28612 KB |
Output is correct |
200 |
Correct |
17 ms |
28620 KB |
Output is correct |
201 |
Correct |
16 ms |
28620 KB |
Output is correct |
202 |
Correct |
20 ms |
28616 KB |
Output is correct |
203 |
Correct |
22 ms |
28544 KB |
Output is correct |
204 |
Correct |
18 ms |
28548 KB |
Output is correct |
205 |
Correct |
21 ms |
28584 KB |
Output is correct |
206 |
Correct |
20 ms |
28540 KB |
Output is correct |
207 |
Correct |
18 ms |
28620 KB |
Output is correct |
208 |
Correct |
19 ms |
28620 KB |
Output is correct |
209 |
Correct |
19 ms |
29620 KB |
Output is correct |
210 |
Correct |
106 ms |
39136 KB |
Output is correct |
211 |
Correct |
182 ms |
44000 KB |
Output is correct |
212 |
Correct |
167 ms |
46952 KB |
Output is correct |
213 |
Correct |
175 ms |
49084 KB |
Output is correct |
214 |
Correct |
81 ms |
42580 KB |
Output is correct |
215 |
Correct |
91 ms |
42316 KB |
Output is correct |
216 |
Correct |
196 ms |
44624 KB |
Output is correct |
217 |
Correct |
172 ms |
43300 KB |
Output is correct |
218 |
Correct |
150 ms |
41944 KB |
Output is correct |
219 |
Correct |
121 ms |
41544 KB |
Output is correct |
220 |
Correct |
130 ms |
41540 KB |
Output is correct |
221 |
Correct |
124 ms |
41412 KB |
Output is correct |
222 |
Correct |
114 ms |
42648 KB |
Output is correct |
223 |
Correct |
214 ms |
45788 KB |
Output is correct |
224 |
Correct |
170 ms |
45028 KB |
Output is correct |
225 |
Correct |
183 ms |
42956 KB |
Output is correct |
226 |
Correct |
141 ms |
42948 KB |
Output is correct |
227 |
Correct |
175 ms |
43020 KB |
Output is correct |
228 |
Correct |
190 ms |
42612 KB |
Output is correct |
229 |
Correct |
125 ms |
42364 KB |
Output is correct |
230 |
Correct |
170 ms |
43576 KB |
Output is correct |
231 |
Correct |
146 ms |
43588 KB |
Output is correct |