#include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
using pib = pair<int,bool>;
using ll = long long;
using pll = pair<ll,ll>;
using ld = long double;
#define all(x) (x).begin(),(x).end()
#ifdef fread_unlocked
#define fread fread_unlocked
#define fwrite fwrite_unlocked
#endif
#define lc ind<<1
#define rc ind<<1|1
const int MN = 5e5+3;
vector<int> oadj[MN], adj[MN]; vector<vector<int>> comps; stack<int> st;
bool art[MN], vis[MN]; int over[MN], n, csz, dep[MN], p[MN], subsz[MN], sz[MN]; ll ans;
void dfs (int cur, int par = -1) {
st.push(cur); int cnt = 0;
for (int i : oadj[cur]) if (i != par) {
if (!dep[i]) {
dep[i] = dep[cur] + 1;
int before = over[cur];
dfs(i,cur);
over[cur] += over[i];
if (before == over[cur]) {
art[cur] = ~par || cnt++;
comps.push_back({cur});
while (comps.back().back() != i) comps.back().push_back(st.top()), st.pop();
}
} else if (dep[i] < dep[cur]) ++over[par], --over[i];
}
}
void dfs3 (int cur, int par = -1) {
csz+=sz[cur]; vis[cur] = 1;
for (int i : adj[cur]) if (i != par) dfs3(i,cur);
}
void dfs2 (int cur, int par = -1) {
subsz[cur] = sz[cur];
for (int i : adj[cur]) if (i != par) {
dfs2(i,cur);
subsz[cur] += subsz[i];
}
if (art[cur]) return;
int dont = !!(~par); //we dont want to consider our parent articulation point, it was already considered by its parent
//printf ("cur %d sz %d subsz %d dont %d\n",cur,sz[cur],subsz[cur],dont);
//the only one we take here is B
ans += (sz[cur]-dont) * 1LL * (subsz[cur]-sz[cur]) * 1LL * (csz-subsz[cur]);//printf ("adding %d*%d*%d\n",sz[cur]-dont,(subsz[cur]-sz[cur]),csz-subsz[cur]);
//take all 3 here
ans += (sz[cur]) * 1LL * (sz[cur]-1) * 1LL * (sz[cur]-2)/2;//printf ("adding %d*%d*%d/2\n",sz[cur]-dont,sz[cur]-1,sz[cur]-2);
//take 2 here
//printf ("adding %d*%d*%d\n",sz[cur]-1,sz[cur]-1-dont,csz-sz[cur]);
if (!dont) ans += (sz[cur]-1) * 1LL * (sz[cur]-1) * 1LL * (csz - sz[cur]);
else ans += (sz[cur]-1) * 1LL * (sz[cur]-2) * 1LL * (csz-subsz[cur]) + (sz[cur]-1) * 1LL * (sz[cur]-1) * 1LL * (subsz[cur]-sz[cur]);
int sofar = 0;
for (int i : adj[cur]) if (i != par) {
ans += subsz[i] * 1LL * (sz[cur]) * 1LL * sofar;
int nest = 0;
for (int j : adj[i]) if (j != cur) {
ans += (subsz[j]-1) * 1LL * nest;
nest += (subsz[j]-1);
}
//printf ("adding %d*%d*%d\n",subsz[i],sz[cur]-dont,sofar);
sofar += subsz[i];
}
}
void print () {
printf ("-----------COMPS------------\n");
for (vector<int>&v : comps) {
for (int i : v) printf ("%d ",i);
printf ("\n");
}
printf ("---------------------------\n");
}
int main() {
int m;
scanf ("%d %d",&n,&m);
while (m--) {
int a,b; scanf ("%d %d",&a,&b);
oadj[a].push_back(b); oadj[b].push_back(a);
}
for (int i = 1; i <= n; i++) if (!dep[i]) {
dep[i]=1;
dfs(i);
}
int nn = 0;
for (vector<int> &v : comps) {
int id = ++nn;
while (art[id]) id=++nn;
//printf ("id %d: ",id);
//for (int i : v) printf ("%d ",i);
//printf ("\n");
sz[id] = v.size();
for (int j : v) if (art[j]) adj[id].push_back(j), adj[j].push_back(id);
}
for (int i = 1; i <= n; i++) if (art[i]) sz[i] = -(int)adj[i].size() + 1;
for (int i = 1; i <= nn; i++) if (!vis[i] && !art[i]) {
csz=0;
dfs3(i);
dfs2(i);
}
printf ("%lld\n",ans<<1);
return 0;
}
Compilation message
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:77:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d %d",&n,&m);
~~~~~~^~~~~~~~~~~~~~~
count_triplets.cpp:79:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int a,b; scanf ("%d %d",&a,&b);
~~~~~~^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
23808 KB |
Output is correct |
2 |
Correct |
20 ms |
23808 KB |
Output is correct |
3 |
Correct |
19 ms |
23808 KB |
Output is correct |
4 |
Correct |
19 ms |
23808 KB |
Output is correct |
5 |
Correct |
18 ms |
23808 KB |
Output is correct |
6 |
Correct |
19 ms |
23808 KB |
Output is correct |
7 |
Correct |
18 ms |
23808 KB |
Output is correct |
8 |
Correct |
19 ms |
23808 KB |
Output is correct |
9 |
Correct |
20 ms |
23808 KB |
Output is correct |
10 |
Correct |
19 ms |
23808 KB |
Output is correct |
11 |
Correct |
18 ms |
23808 KB |
Output is correct |
12 |
Correct |
18 ms |
23808 KB |
Output is correct |
13 |
Correct |
18 ms |
23824 KB |
Output is correct |
14 |
Correct |
19 ms |
23808 KB |
Output is correct |
15 |
Correct |
21 ms |
23808 KB |
Output is correct |
16 |
Correct |
20 ms |
23808 KB |
Output is correct |
17 |
Correct |
18 ms |
23896 KB |
Output is correct |
18 |
Correct |
19 ms |
23808 KB |
Output is correct |
19 |
Correct |
19 ms |
23808 KB |
Output is correct |
20 |
Correct |
24 ms |
23808 KB |
Output is correct |
21 |
Correct |
18 ms |
23808 KB |
Output is correct |
22 |
Correct |
18 ms |
23808 KB |
Output is correct |
23 |
Correct |
18 ms |
23808 KB |
Output is correct |
24 |
Correct |
18 ms |
23808 KB |
Output is correct |
25 |
Correct |
18 ms |
23936 KB |
Output is correct |
26 |
Correct |
18 ms |
23808 KB |
Output is correct |
27 |
Correct |
19 ms |
23808 KB |
Output is correct |
28 |
Correct |
18 ms |
23936 KB |
Output is correct |
29 |
Correct |
18 ms |
23808 KB |
Output is correct |
30 |
Correct |
19 ms |
23808 KB |
Output is correct |
31 |
Correct |
18 ms |
23808 KB |
Output is correct |
32 |
Correct |
18 ms |
23808 KB |
Output is correct |
33 |
Correct |
19 ms |
23808 KB |
Output is correct |
34 |
Correct |
18 ms |
23808 KB |
Output is correct |
35 |
Correct |
18 ms |
23808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
23808 KB |
Output is correct |
2 |
Correct |
20 ms |
23808 KB |
Output is correct |
3 |
Correct |
19 ms |
23808 KB |
Output is correct |
4 |
Correct |
19 ms |
23808 KB |
Output is correct |
5 |
Correct |
18 ms |
23808 KB |
Output is correct |
6 |
Correct |
19 ms |
23808 KB |
Output is correct |
7 |
Correct |
18 ms |
23808 KB |
Output is correct |
8 |
Correct |
19 ms |
23808 KB |
Output is correct |
9 |
Correct |
20 ms |
23808 KB |
Output is correct |
10 |
Correct |
19 ms |
23808 KB |
Output is correct |
11 |
Correct |
18 ms |
23808 KB |
Output is correct |
12 |
Correct |
18 ms |
23808 KB |
Output is correct |
13 |
Correct |
18 ms |
23824 KB |
Output is correct |
14 |
Correct |
19 ms |
23808 KB |
Output is correct |
15 |
Correct |
21 ms |
23808 KB |
Output is correct |
16 |
Correct |
20 ms |
23808 KB |
Output is correct |
17 |
Correct |
18 ms |
23896 KB |
Output is correct |
18 |
Correct |
19 ms |
23808 KB |
Output is correct |
19 |
Correct |
19 ms |
23808 KB |
Output is correct |
20 |
Correct |
24 ms |
23808 KB |
Output is correct |
21 |
Correct |
18 ms |
23808 KB |
Output is correct |
22 |
Correct |
18 ms |
23808 KB |
Output is correct |
23 |
Correct |
18 ms |
23808 KB |
Output is correct |
24 |
Correct |
18 ms |
23808 KB |
Output is correct |
25 |
Correct |
18 ms |
23936 KB |
Output is correct |
26 |
Correct |
18 ms |
23808 KB |
Output is correct |
27 |
Correct |
19 ms |
23808 KB |
Output is correct |
28 |
Correct |
18 ms |
23936 KB |
Output is correct |
29 |
Correct |
18 ms |
23808 KB |
Output is correct |
30 |
Correct |
19 ms |
23808 KB |
Output is correct |
31 |
Correct |
18 ms |
23808 KB |
Output is correct |
32 |
Correct |
18 ms |
23808 KB |
Output is correct |
33 |
Correct |
19 ms |
23808 KB |
Output is correct |
34 |
Correct |
18 ms |
23808 KB |
Output is correct |
35 |
Correct |
18 ms |
23808 KB |
Output is correct |
36 |
Correct |
18 ms |
23808 KB |
Output is correct |
37 |
Correct |
18 ms |
23808 KB |
Output is correct |
38 |
Correct |
18 ms |
23936 KB |
Output is correct |
39 |
Correct |
18 ms |
23808 KB |
Output is correct |
40 |
Correct |
18 ms |
23808 KB |
Output is correct |
41 |
Correct |
18 ms |
23808 KB |
Output is correct |
42 |
Correct |
18 ms |
23808 KB |
Output is correct |
43 |
Correct |
18 ms |
23808 KB |
Output is correct |
44 |
Correct |
18 ms |
23808 KB |
Output is correct |
45 |
Correct |
18 ms |
23808 KB |
Output is correct |
46 |
Correct |
18 ms |
23808 KB |
Output is correct |
47 |
Correct |
18 ms |
23808 KB |
Output is correct |
48 |
Correct |
18 ms |
23808 KB |
Output is correct |
49 |
Correct |
18 ms |
23808 KB |
Output is correct |
50 |
Correct |
19 ms |
23900 KB |
Output is correct |
51 |
Correct |
18 ms |
23808 KB |
Output is correct |
52 |
Correct |
20 ms |
23792 KB |
Output is correct |
53 |
Correct |
19 ms |
23808 KB |
Output is correct |
54 |
Correct |
19 ms |
23936 KB |
Output is correct |
55 |
Correct |
18 ms |
23860 KB |
Output is correct |
56 |
Correct |
18 ms |
23808 KB |
Output is correct |
57 |
Correct |
19 ms |
23808 KB |
Output is correct |
58 |
Correct |
18 ms |
23808 KB |
Output is correct |
59 |
Correct |
18 ms |
23808 KB |
Output is correct |
60 |
Correct |
19 ms |
23808 KB |
Output is correct |
61 |
Correct |
18 ms |
23808 KB |
Output is correct |
62 |
Correct |
18 ms |
23808 KB |
Output is correct |
63 |
Correct |
18 ms |
23936 KB |
Output is correct |
64 |
Correct |
21 ms |
23808 KB |
Output is correct |
65 |
Correct |
18 ms |
23808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
90 ms |
40880 KB |
Output is correct |
2 |
Correct |
110 ms |
40972 KB |
Output is correct |
3 |
Correct |
121 ms |
43832 KB |
Output is correct |
4 |
Correct |
103 ms |
41396 KB |
Output is correct |
5 |
Correct |
116 ms |
39300 KB |
Output is correct |
6 |
Correct |
128 ms |
45556 KB |
Output is correct |
7 |
Correct |
136 ms |
40520 KB |
Output is correct |
8 |
Correct |
134 ms |
43048 KB |
Output is correct |
9 |
Correct |
125 ms |
39188 KB |
Output is correct |
10 |
Correct |
113 ms |
38716 KB |
Output is correct |
11 |
Correct |
109 ms |
34472 KB |
Output is correct |
12 |
Correct |
95 ms |
34476 KB |
Output is correct |
13 |
Correct |
93 ms |
33836 KB |
Output is correct |
14 |
Correct |
84 ms |
33704 KB |
Output is correct |
15 |
Correct |
65 ms |
32172 KB |
Output is correct |
16 |
Correct |
70 ms |
32044 KB |
Output is correct |
17 |
Correct |
20 ms |
25088 KB |
Output is correct |
18 |
Correct |
20 ms |
25088 KB |
Output is correct |
19 |
Correct |
19 ms |
24960 KB |
Output is correct |
20 |
Correct |
21 ms |
25136 KB |
Output is correct |
21 |
Correct |
19 ms |
24960 KB |
Output is correct |
22 |
Correct |
21 ms |
24960 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
24192 KB |
Output is correct |
2 |
Correct |
19 ms |
24064 KB |
Output is correct |
3 |
Correct |
19 ms |
24064 KB |
Output is correct |
4 |
Correct |
19 ms |
24192 KB |
Output is correct |
5 |
Correct |
19 ms |
24064 KB |
Output is correct |
6 |
Correct |
19 ms |
24064 KB |
Output is correct |
7 |
Correct |
20 ms |
24192 KB |
Output is correct |
8 |
Correct |
19 ms |
24064 KB |
Output is correct |
9 |
Correct |
19 ms |
24064 KB |
Output is correct |
10 |
Correct |
19 ms |
24064 KB |
Output is correct |
11 |
Correct |
20 ms |
24064 KB |
Output is correct |
12 |
Correct |
19 ms |
24064 KB |
Output is correct |
13 |
Correct |
19 ms |
24064 KB |
Output is correct |
14 |
Correct |
19 ms |
23936 KB |
Output is correct |
15 |
Correct |
19 ms |
24064 KB |
Output is correct |
16 |
Correct |
19 ms |
23936 KB |
Output is correct |
17 |
Correct |
19 ms |
23936 KB |
Output is correct |
18 |
Correct |
19 ms |
23936 KB |
Output is correct |
19 |
Correct |
19 ms |
23936 KB |
Output is correct |
20 |
Correct |
19 ms |
23936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
132 ms |
40868 KB |
Output is correct |
2 |
Correct |
129 ms |
40868 KB |
Output is correct |
3 |
Correct |
140 ms |
40868 KB |
Output is correct |
4 |
Correct |
132 ms |
40868 KB |
Output is correct |
5 |
Correct |
131 ms |
40744 KB |
Output is correct |
6 |
Correct |
184 ms |
58276 KB |
Output is correct |
7 |
Correct |
158 ms |
47328 KB |
Output is correct |
8 |
Correct |
146 ms |
45728 KB |
Output is correct |
9 |
Correct |
152 ms |
44112 KB |
Output is correct |
10 |
Correct |
131 ms |
40864 KB |
Output is correct |
11 |
Correct |
142 ms |
40868 KB |
Output is correct |
12 |
Correct |
131 ms |
40868 KB |
Output is correct |
13 |
Correct |
131 ms |
40868 KB |
Output is correct |
14 |
Correct |
120 ms |
39584 KB |
Output is correct |
15 |
Correct |
125 ms |
38056 KB |
Output is correct |
16 |
Correct |
75 ms |
33324 KB |
Output is correct |
17 |
Correct |
83 ms |
38884 KB |
Output is correct |
18 |
Correct |
87 ms |
38880 KB |
Output is correct |
19 |
Correct |
88 ms |
39212 KB |
Output is correct |
20 |
Correct |
95 ms |
38952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
24064 KB |
Output is correct |
2 |
Correct |
20 ms |
24064 KB |
Output is correct |
3 |
Correct |
19 ms |
23936 KB |
Output is correct |
4 |
Correct |
19 ms |
23936 KB |
Output is correct |
5 |
Correct |
21 ms |
23936 KB |
Output is correct |
6 |
Correct |
19 ms |
23936 KB |
Output is correct |
7 |
Correct |
19 ms |
23936 KB |
Output is correct |
8 |
Correct |
19 ms |
23936 KB |
Output is correct |
9 |
Correct |
19 ms |
23936 KB |
Output is correct |
10 |
Correct |
19 ms |
23936 KB |
Output is correct |
11 |
Correct |
19 ms |
23936 KB |
Output is correct |
12 |
Correct |
19 ms |
24064 KB |
Output is correct |
13 |
Correct |
19 ms |
24064 KB |
Output is correct |
14 |
Correct |
20 ms |
24064 KB |
Output is correct |
15 |
Correct |
19 ms |
23984 KB |
Output is correct |
16 |
Correct |
19 ms |
24192 KB |
Output is correct |
17 |
Correct |
19 ms |
23936 KB |
Output is correct |
18 |
Correct |
21 ms |
23936 KB |
Output is correct |
19 |
Correct |
18 ms |
23936 KB |
Output is correct |
20 |
Correct |
20 ms |
23936 KB |
Output is correct |
21 |
Correct |
18 ms |
23936 KB |
Output is correct |
22 |
Correct |
19 ms |
23936 KB |
Output is correct |
23 |
Correct |
19 ms |
23936 KB |
Output is correct |
24 |
Correct |
19 ms |
24064 KB |
Output is correct |
25 |
Correct |
18 ms |
23936 KB |
Output is correct |
26 |
Correct |
18 ms |
23936 KB |
Output is correct |
27 |
Correct |
18 ms |
23808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
137 ms |
40792 KB |
Output is correct |
2 |
Correct |
146 ms |
41248 KB |
Output is correct |
3 |
Correct |
140 ms |
39588 KB |
Output is correct |
4 |
Correct |
132 ms |
36908 KB |
Output is correct |
5 |
Correct |
116 ms |
34348 KB |
Output is correct |
6 |
Correct |
115 ms |
33200 KB |
Output is correct |
7 |
Correct |
99 ms |
32692 KB |
Output is correct |
8 |
Correct |
104 ms |
31924 KB |
Output is correct |
9 |
Correct |
109 ms |
31728 KB |
Output is correct |
10 |
Correct |
97 ms |
31480 KB |
Output is correct |
11 |
Correct |
85 ms |
31096 KB |
Output is correct |
12 |
Correct |
101 ms |
30968 KB |
Output is correct |
13 |
Correct |
93 ms |
30968 KB |
Output is correct |
14 |
Correct |
95 ms |
33016 KB |
Output is correct |
15 |
Correct |
160 ms |
45988 KB |
Output is correct |
16 |
Correct |
147 ms |
43688 KB |
Output is correct |
17 |
Correct |
143 ms |
43428 KB |
Output is correct |
18 |
Correct |
143 ms |
41720 KB |
Output is correct |
19 |
Correct |
131 ms |
36908 KB |
Output is correct |
20 |
Correct |
143 ms |
36984 KB |
Output is correct |
21 |
Correct |
135 ms |
36904 KB |
Output is correct |
22 |
Correct |
122 ms |
35496 KB |
Output is correct |
23 |
Correct |
99 ms |
33836 KB |
Output is correct |
24 |
Correct |
125 ms |
39080 KB |
Output is correct |
25 |
Correct |
133 ms |
39080 KB |
Output is correct |
26 |
Correct |
124 ms |
37668 KB |
Output is correct |
27 |
Correct |
135 ms |
37540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
23808 KB |
Output is correct |
2 |
Correct |
20 ms |
23808 KB |
Output is correct |
3 |
Correct |
19 ms |
23808 KB |
Output is correct |
4 |
Correct |
19 ms |
23808 KB |
Output is correct |
5 |
Correct |
18 ms |
23808 KB |
Output is correct |
6 |
Correct |
19 ms |
23808 KB |
Output is correct |
7 |
Correct |
18 ms |
23808 KB |
Output is correct |
8 |
Correct |
19 ms |
23808 KB |
Output is correct |
9 |
Correct |
20 ms |
23808 KB |
Output is correct |
10 |
Correct |
19 ms |
23808 KB |
Output is correct |
11 |
Correct |
18 ms |
23808 KB |
Output is correct |
12 |
Correct |
18 ms |
23808 KB |
Output is correct |
13 |
Correct |
18 ms |
23824 KB |
Output is correct |
14 |
Correct |
19 ms |
23808 KB |
Output is correct |
15 |
Correct |
21 ms |
23808 KB |
Output is correct |
16 |
Correct |
20 ms |
23808 KB |
Output is correct |
17 |
Correct |
18 ms |
23896 KB |
Output is correct |
18 |
Correct |
19 ms |
23808 KB |
Output is correct |
19 |
Correct |
19 ms |
23808 KB |
Output is correct |
20 |
Correct |
24 ms |
23808 KB |
Output is correct |
21 |
Correct |
18 ms |
23808 KB |
Output is correct |
22 |
Correct |
18 ms |
23808 KB |
Output is correct |
23 |
Correct |
18 ms |
23808 KB |
Output is correct |
24 |
Correct |
18 ms |
23808 KB |
Output is correct |
25 |
Correct |
18 ms |
23936 KB |
Output is correct |
26 |
Correct |
18 ms |
23808 KB |
Output is correct |
27 |
Correct |
19 ms |
23808 KB |
Output is correct |
28 |
Correct |
18 ms |
23936 KB |
Output is correct |
29 |
Correct |
18 ms |
23808 KB |
Output is correct |
30 |
Correct |
19 ms |
23808 KB |
Output is correct |
31 |
Correct |
18 ms |
23808 KB |
Output is correct |
32 |
Correct |
18 ms |
23808 KB |
Output is correct |
33 |
Correct |
19 ms |
23808 KB |
Output is correct |
34 |
Correct |
18 ms |
23808 KB |
Output is correct |
35 |
Correct |
18 ms |
23808 KB |
Output is correct |
36 |
Correct |
18 ms |
23808 KB |
Output is correct |
37 |
Correct |
18 ms |
23808 KB |
Output is correct |
38 |
Correct |
18 ms |
23936 KB |
Output is correct |
39 |
Correct |
18 ms |
23808 KB |
Output is correct |
40 |
Correct |
18 ms |
23808 KB |
Output is correct |
41 |
Correct |
18 ms |
23808 KB |
Output is correct |
42 |
Correct |
18 ms |
23808 KB |
Output is correct |
43 |
Correct |
18 ms |
23808 KB |
Output is correct |
44 |
Correct |
18 ms |
23808 KB |
Output is correct |
45 |
Correct |
18 ms |
23808 KB |
Output is correct |
46 |
Correct |
18 ms |
23808 KB |
Output is correct |
47 |
Correct |
18 ms |
23808 KB |
Output is correct |
48 |
Correct |
18 ms |
23808 KB |
Output is correct |
49 |
Correct |
18 ms |
23808 KB |
Output is correct |
50 |
Correct |
19 ms |
23900 KB |
Output is correct |
51 |
Correct |
18 ms |
23808 KB |
Output is correct |
52 |
Correct |
20 ms |
23792 KB |
Output is correct |
53 |
Correct |
19 ms |
23808 KB |
Output is correct |
54 |
Correct |
19 ms |
23936 KB |
Output is correct |
55 |
Correct |
18 ms |
23860 KB |
Output is correct |
56 |
Correct |
18 ms |
23808 KB |
Output is correct |
57 |
Correct |
19 ms |
23808 KB |
Output is correct |
58 |
Correct |
18 ms |
23808 KB |
Output is correct |
59 |
Correct |
18 ms |
23808 KB |
Output is correct |
60 |
Correct |
19 ms |
23808 KB |
Output is correct |
61 |
Correct |
18 ms |
23808 KB |
Output is correct |
62 |
Correct |
18 ms |
23808 KB |
Output is correct |
63 |
Correct |
18 ms |
23936 KB |
Output is correct |
64 |
Correct |
21 ms |
23808 KB |
Output is correct |
65 |
Correct |
18 ms |
23808 KB |
Output is correct |
66 |
Correct |
19 ms |
23936 KB |
Output is correct |
67 |
Correct |
20 ms |
23936 KB |
Output is correct |
68 |
Correct |
19 ms |
23936 KB |
Output is correct |
69 |
Correct |
20 ms |
23936 KB |
Output is correct |
70 |
Correct |
20 ms |
23936 KB |
Output is correct |
71 |
Correct |
18 ms |
23936 KB |
Output is correct |
72 |
Correct |
18 ms |
23936 KB |
Output is correct |
73 |
Correct |
19 ms |
23936 KB |
Output is correct |
74 |
Correct |
19 ms |
23936 KB |
Output is correct |
75 |
Correct |
19 ms |
23936 KB |
Output is correct |
76 |
Correct |
18 ms |
23808 KB |
Output is correct |
77 |
Correct |
19 ms |
23936 KB |
Output is correct |
78 |
Correct |
19 ms |
23936 KB |
Output is correct |
79 |
Correct |
21 ms |
23936 KB |
Output is correct |
80 |
Correct |
19 ms |
23936 KB |
Output is correct |
81 |
Correct |
18 ms |
23936 KB |
Output is correct |
82 |
Correct |
19 ms |
24064 KB |
Output is correct |
83 |
Correct |
19 ms |
23936 KB |
Output is correct |
84 |
Correct |
19 ms |
24064 KB |
Output is correct |
85 |
Correct |
19 ms |
23936 KB |
Output is correct |
86 |
Correct |
19 ms |
23936 KB |
Output is correct |
87 |
Correct |
19 ms |
23936 KB |
Output is correct |
88 |
Correct |
19 ms |
23936 KB |
Output is correct |
89 |
Correct |
19 ms |
23936 KB |
Output is correct |
90 |
Correct |
19 ms |
23936 KB |
Output is correct |
91 |
Correct |
19 ms |
23936 KB |
Output is correct |
92 |
Correct |
19 ms |
23936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
23808 KB |
Output is correct |
2 |
Correct |
20 ms |
23808 KB |
Output is correct |
3 |
Correct |
19 ms |
23808 KB |
Output is correct |
4 |
Correct |
19 ms |
23808 KB |
Output is correct |
5 |
Correct |
18 ms |
23808 KB |
Output is correct |
6 |
Correct |
19 ms |
23808 KB |
Output is correct |
7 |
Correct |
18 ms |
23808 KB |
Output is correct |
8 |
Correct |
19 ms |
23808 KB |
Output is correct |
9 |
Correct |
20 ms |
23808 KB |
Output is correct |
10 |
Correct |
19 ms |
23808 KB |
Output is correct |
11 |
Correct |
18 ms |
23808 KB |
Output is correct |
12 |
Correct |
18 ms |
23808 KB |
Output is correct |
13 |
Correct |
18 ms |
23824 KB |
Output is correct |
14 |
Correct |
19 ms |
23808 KB |
Output is correct |
15 |
Correct |
21 ms |
23808 KB |
Output is correct |
16 |
Correct |
20 ms |
23808 KB |
Output is correct |
17 |
Correct |
18 ms |
23896 KB |
Output is correct |
18 |
Correct |
19 ms |
23808 KB |
Output is correct |
19 |
Correct |
19 ms |
23808 KB |
Output is correct |
20 |
Correct |
24 ms |
23808 KB |
Output is correct |
21 |
Correct |
18 ms |
23808 KB |
Output is correct |
22 |
Correct |
18 ms |
23808 KB |
Output is correct |
23 |
Correct |
18 ms |
23808 KB |
Output is correct |
24 |
Correct |
18 ms |
23808 KB |
Output is correct |
25 |
Correct |
18 ms |
23936 KB |
Output is correct |
26 |
Correct |
18 ms |
23808 KB |
Output is correct |
27 |
Correct |
19 ms |
23808 KB |
Output is correct |
28 |
Correct |
18 ms |
23936 KB |
Output is correct |
29 |
Correct |
18 ms |
23808 KB |
Output is correct |
30 |
Correct |
19 ms |
23808 KB |
Output is correct |
31 |
Correct |
18 ms |
23808 KB |
Output is correct |
32 |
Correct |
18 ms |
23808 KB |
Output is correct |
33 |
Correct |
19 ms |
23808 KB |
Output is correct |
34 |
Correct |
18 ms |
23808 KB |
Output is correct |
35 |
Correct |
18 ms |
23808 KB |
Output is correct |
36 |
Correct |
18 ms |
23808 KB |
Output is correct |
37 |
Correct |
18 ms |
23808 KB |
Output is correct |
38 |
Correct |
18 ms |
23936 KB |
Output is correct |
39 |
Correct |
18 ms |
23808 KB |
Output is correct |
40 |
Correct |
18 ms |
23808 KB |
Output is correct |
41 |
Correct |
18 ms |
23808 KB |
Output is correct |
42 |
Correct |
18 ms |
23808 KB |
Output is correct |
43 |
Correct |
18 ms |
23808 KB |
Output is correct |
44 |
Correct |
18 ms |
23808 KB |
Output is correct |
45 |
Correct |
18 ms |
23808 KB |
Output is correct |
46 |
Correct |
18 ms |
23808 KB |
Output is correct |
47 |
Correct |
18 ms |
23808 KB |
Output is correct |
48 |
Correct |
18 ms |
23808 KB |
Output is correct |
49 |
Correct |
18 ms |
23808 KB |
Output is correct |
50 |
Correct |
19 ms |
23900 KB |
Output is correct |
51 |
Correct |
18 ms |
23808 KB |
Output is correct |
52 |
Correct |
20 ms |
23792 KB |
Output is correct |
53 |
Correct |
19 ms |
23808 KB |
Output is correct |
54 |
Correct |
19 ms |
23936 KB |
Output is correct |
55 |
Correct |
18 ms |
23860 KB |
Output is correct |
56 |
Correct |
18 ms |
23808 KB |
Output is correct |
57 |
Correct |
19 ms |
23808 KB |
Output is correct |
58 |
Correct |
18 ms |
23808 KB |
Output is correct |
59 |
Correct |
18 ms |
23808 KB |
Output is correct |
60 |
Correct |
19 ms |
23808 KB |
Output is correct |
61 |
Correct |
18 ms |
23808 KB |
Output is correct |
62 |
Correct |
18 ms |
23808 KB |
Output is correct |
63 |
Correct |
18 ms |
23936 KB |
Output is correct |
64 |
Correct |
21 ms |
23808 KB |
Output is correct |
65 |
Correct |
18 ms |
23808 KB |
Output is correct |
66 |
Correct |
90 ms |
40880 KB |
Output is correct |
67 |
Correct |
110 ms |
40972 KB |
Output is correct |
68 |
Correct |
121 ms |
43832 KB |
Output is correct |
69 |
Correct |
103 ms |
41396 KB |
Output is correct |
70 |
Correct |
116 ms |
39300 KB |
Output is correct |
71 |
Correct |
128 ms |
45556 KB |
Output is correct |
72 |
Correct |
136 ms |
40520 KB |
Output is correct |
73 |
Correct |
134 ms |
43048 KB |
Output is correct |
74 |
Correct |
125 ms |
39188 KB |
Output is correct |
75 |
Correct |
113 ms |
38716 KB |
Output is correct |
76 |
Correct |
109 ms |
34472 KB |
Output is correct |
77 |
Correct |
95 ms |
34476 KB |
Output is correct |
78 |
Correct |
93 ms |
33836 KB |
Output is correct |
79 |
Correct |
84 ms |
33704 KB |
Output is correct |
80 |
Correct |
65 ms |
32172 KB |
Output is correct |
81 |
Correct |
70 ms |
32044 KB |
Output is correct |
82 |
Correct |
20 ms |
25088 KB |
Output is correct |
83 |
Correct |
20 ms |
25088 KB |
Output is correct |
84 |
Correct |
19 ms |
24960 KB |
Output is correct |
85 |
Correct |
21 ms |
25136 KB |
Output is correct |
86 |
Correct |
19 ms |
24960 KB |
Output is correct |
87 |
Correct |
21 ms |
24960 KB |
Output is correct |
88 |
Correct |
19 ms |
24192 KB |
Output is correct |
89 |
Correct |
19 ms |
24064 KB |
Output is correct |
90 |
Correct |
19 ms |
24064 KB |
Output is correct |
91 |
Correct |
19 ms |
24192 KB |
Output is correct |
92 |
Correct |
19 ms |
24064 KB |
Output is correct |
93 |
Correct |
19 ms |
24064 KB |
Output is correct |
94 |
Correct |
20 ms |
24192 KB |
Output is correct |
95 |
Correct |
19 ms |
24064 KB |
Output is correct |
96 |
Correct |
19 ms |
24064 KB |
Output is correct |
97 |
Correct |
19 ms |
24064 KB |
Output is correct |
98 |
Correct |
20 ms |
24064 KB |
Output is correct |
99 |
Correct |
19 ms |
24064 KB |
Output is correct |
100 |
Correct |
19 ms |
24064 KB |
Output is correct |
101 |
Correct |
19 ms |
23936 KB |
Output is correct |
102 |
Correct |
19 ms |
24064 KB |
Output is correct |
103 |
Correct |
19 ms |
23936 KB |
Output is correct |
104 |
Correct |
19 ms |
23936 KB |
Output is correct |
105 |
Correct |
19 ms |
23936 KB |
Output is correct |
106 |
Correct |
19 ms |
23936 KB |
Output is correct |
107 |
Correct |
19 ms |
23936 KB |
Output is correct |
108 |
Correct |
132 ms |
40868 KB |
Output is correct |
109 |
Correct |
129 ms |
40868 KB |
Output is correct |
110 |
Correct |
140 ms |
40868 KB |
Output is correct |
111 |
Correct |
132 ms |
40868 KB |
Output is correct |
112 |
Correct |
131 ms |
40744 KB |
Output is correct |
113 |
Correct |
184 ms |
58276 KB |
Output is correct |
114 |
Correct |
158 ms |
47328 KB |
Output is correct |
115 |
Correct |
146 ms |
45728 KB |
Output is correct |
116 |
Correct |
152 ms |
44112 KB |
Output is correct |
117 |
Correct |
131 ms |
40864 KB |
Output is correct |
118 |
Correct |
142 ms |
40868 KB |
Output is correct |
119 |
Correct |
131 ms |
40868 KB |
Output is correct |
120 |
Correct |
131 ms |
40868 KB |
Output is correct |
121 |
Correct |
120 ms |
39584 KB |
Output is correct |
122 |
Correct |
125 ms |
38056 KB |
Output is correct |
123 |
Correct |
75 ms |
33324 KB |
Output is correct |
124 |
Correct |
83 ms |
38884 KB |
Output is correct |
125 |
Correct |
87 ms |
38880 KB |
Output is correct |
126 |
Correct |
88 ms |
39212 KB |
Output is correct |
127 |
Correct |
95 ms |
38952 KB |
Output is correct |
128 |
Correct |
26 ms |
24064 KB |
Output is correct |
129 |
Correct |
20 ms |
24064 KB |
Output is correct |
130 |
Correct |
19 ms |
23936 KB |
Output is correct |
131 |
Correct |
19 ms |
23936 KB |
Output is correct |
132 |
Correct |
21 ms |
23936 KB |
Output is correct |
133 |
Correct |
19 ms |
23936 KB |
Output is correct |
134 |
Correct |
19 ms |
23936 KB |
Output is correct |
135 |
Correct |
19 ms |
23936 KB |
Output is correct |
136 |
Correct |
19 ms |
23936 KB |
Output is correct |
137 |
Correct |
19 ms |
23936 KB |
Output is correct |
138 |
Correct |
19 ms |
23936 KB |
Output is correct |
139 |
Correct |
19 ms |
24064 KB |
Output is correct |
140 |
Correct |
19 ms |
24064 KB |
Output is correct |
141 |
Correct |
20 ms |
24064 KB |
Output is correct |
142 |
Correct |
19 ms |
23984 KB |
Output is correct |
143 |
Correct |
19 ms |
24192 KB |
Output is correct |
144 |
Correct |
19 ms |
23936 KB |
Output is correct |
145 |
Correct |
21 ms |
23936 KB |
Output is correct |
146 |
Correct |
18 ms |
23936 KB |
Output is correct |
147 |
Correct |
20 ms |
23936 KB |
Output is correct |
148 |
Correct |
18 ms |
23936 KB |
Output is correct |
149 |
Correct |
19 ms |
23936 KB |
Output is correct |
150 |
Correct |
19 ms |
23936 KB |
Output is correct |
151 |
Correct |
19 ms |
24064 KB |
Output is correct |
152 |
Correct |
18 ms |
23936 KB |
Output is correct |
153 |
Correct |
18 ms |
23936 KB |
Output is correct |
154 |
Correct |
18 ms |
23808 KB |
Output is correct |
155 |
Correct |
137 ms |
40792 KB |
Output is correct |
156 |
Correct |
146 ms |
41248 KB |
Output is correct |
157 |
Correct |
140 ms |
39588 KB |
Output is correct |
158 |
Correct |
132 ms |
36908 KB |
Output is correct |
159 |
Correct |
116 ms |
34348 KB |
Output is correct |
160 |
Correct |
115 ms |
33200 KB |
Output is correct |
161 |
Correct |
99 ms |
32692 KB |
Output is correct |
162 |
Correct |
104 ms |
31924 KB |
Output is correct |
163 |
Correct |
109 ms |
31728 KB |
Output is correct |
164 |
Correct |
97 ms |
31480 KB |
Output is correct |
165 |
Correct |
85 ms |
31096 KB |
Output is correct |
166 |
Correct |
101 ms |
30968 KB |
Output is correct |
167 |
Correct |
93 ms |
30968 KB |
Output is correct |
168 |
Correct |
95 ms |
33016 KB |
Output is correct |
169 |
Correct |
160 ms |
45988 KB |
Output is correct |
170 |
Correct |
147 ms |
43688 KB |
Output is correct |
171 |
Correct |
143 ms |
43428 KB |
Output is correct |
172 |
Correct |
143 ms |
41720 KB |
Output is correct |
173 |
Correct |
131 ms |
36908 KB |
Output is correct |
174 |
Correct |
143 ms |
36984 KB |
Output is correct |
175 |
Correct |
135 ms |
36904 KB |
Output is correct |
176 |
Correct |
122 ms |
35496 KB |
Output is correct |
177 |
Correct |
99 ms |
33836 KB |
Output is correct |
178 |
Correct |
125 ms |
39080 KB |
Output is correct |
179 |
Correct |
133 ms |
39080 KB |
Output is correct |
180 |
Correct |
124 ms |
37668 KB |
Output is correct |
181 |
Correct |
135 ms |
37540 KB |
Output is correct |
182 |
Correct |
19 ms |
23936 KB |
Output is correct |
183 |
Correct |
20 ms |
23936 KB |
Output is correct |
184 |
Correct |
19 ms |
23936 KB |
Output is correct |
185 |
Correct |
20 ms |
23936 KB |
Output is correct |
186 |
Correct |
20 ms |
23936 KB |
Output is correct |
187 |
Correct |
18 ms |
23936 KB |
Output is correct |
188 |
Correct |
18 ms |
23936 KB |
Output is correct |
189 |
Correct |
19 ms |
23936 KB |
Output is correct |
190 |
Correct |
19 ms |
23936 KB |
Output is correct |
191 |
Correct |
19 ms |
23936 KB |
Output is correct |
192 |
Correct |
18 ms |
23808 KB |
Output is correct |
193 |
Correct |
19 ms |
23936 KB |
Output is correct |
194 |
Correct |
19 ms |
23936 KB |
Output is correct |
195 |
Correct |
21 ms |
23936 KB |
Output is correct |
196 |
Correct |
19 ms |
23936 KB |
Output is correct |
197 |
Correct |
18 ms |
23936 KB |
Output is correct |
198 |
Correct |
19 ms |
24064 KB |
Output is correct |
199 |
Correct |
19 ms |
23936 KB |
Output is correct |
200 |
Correct |
19 ms |
24064 KB |
Output is correct |
201 |
Correct |
19 ms |
23936 KB |
Output is correct |
202 |
Correct |
19 ms |
23936 KB |
Output is correct |
203 |
Correct |
19 ms |
23936 KB |
Output is correct |
204 |
Correct |
19 ms |
23936 KB |
Output is correct |
205 |
Correct |
19 ms |
23936 KB |
Output is correct |
206 |
Correct |
19 ms |
23936 KB |
Output is correct |
207 |
Correct |
19 ms |
23936 KB |
Output is correct |
208 |
Correct |
19 ms |
23936 KB |
Output is correct |
209 |
Correct |
19 ms |
24704 KB |
Output is correct |
210 |
Correct |
72 ms |
33452 KB |
Output is correct |
211 |
Correct |
101 ms |
36776 KB |
Output is correct |
212 |
Correct |
142 ms |
38496 KB |
Output is correct |
213 |
Correct |
151 ms |
39712 KB |
Output is correct |
214 |
Correct |
80 ms |
34092 KB |
Output is correct |
215 |
Correct |
80 ms |
33152 KB |
Output is correct |
216 |
Correct |
134 ms |
37416 KB |
Output is correct |
217 |
Correct |
130 ms |
34896 KB |
Output is correct |
218 |
Correct |
106 ms |
32052 KB |
Output is correct |
219 |
Correct |
97 ms |
31352 KB |
Output is correct |
220 |
Correct |
91 ms |
31096 KB |
Output is correct |
221 |
Correct |
84 ms |
30840 KB |
Output is correct |
222 |
Correct |
86 ms |
31480 KB |
Output is correct |
223 |
Correct |
134 ms |
37932 KB |
Output is correct |
224 |
Correct |
134 ms |
36972 KB |
Output is correct |
225 |
Correct |
126 ms |
34308 KB |
Output is correct |
226 |
Correct |
127 ms |
34392 KB |
Output is correct |
227 |
Correct |
123 ms |
34220 KB |
Output is correct |
228 |
Correct |
111 ms |
33456 KB |
Output is correct |
229 |
Correct |
101 ms |
32304 KB |
Output is correct |
230 |
Correct |
116 ms |
33948 KB |
Output is correct |
231 |
Correct |
117 ms |
33992 KB |
Output is correct |