#include <bits/stdc++.h>
using namespace std;
const int N = 800006;
int e[N];
vector<int> G[N];
int dfn_clock[N];
int stamp=0;
bool vis[N];
int low[N];
stack<int> sta;
vector<int> bcc[N];
vector<int> vv[N];
int bcc_no = 0;
void dfs(int now,int par)
{
//cout << "now = " << now << " , par = " << par <<endl;
dfn_clock[now] = low[now] = (++stamp);
vis[now] = true;
for (int i:G[now])
{
int to = (e[i]^now);
if (to == par) continue;
if (!vis[to])
{
sta.push(i);
dfs(to,now);
low[now] = min(low[now],low[to]);
if (low[to] >= dfn_clock[now])
{
bcc_no++;
int p;
do {
p = sta.top();
bcc[bcc_no].push_back(p);
sta.pop();
} while (p != i);
}
}
else if (dfn_clock[to] < dfn_clock[now])
{
sta.push(i);
low[now] = min(low[now],dfn_clock[to]);
}
}
}
typedef long long LL;
LL ans=0;
int cnt[N];
int in_bcc[N];
int type[N];
int sz[N];
int n,m;
int vis2[N];
int vis_id = 880301;
int xx[N],yy[N];
vector<int> G2[N];
int subtree_sz[N];
int n_cid[N];
int parr[N];
void dfs2(int now,int par,int cid)
{
vis[now] = true;
subtree_sz[now] = sz[now];
parr[now] = par;
for (int i:G2[now])
{
if(i != par)
{
dfs2(i,now,cid);
subtree_sz[now] += subtree_sz[i];
}
}
if (now == par)
{
n_cid[cid] = subtree_sz[now];
}
}
LL tott1[N],tott2[N];
void dfs4(int now,int par,int cid)
{
vis[now] = true;
if (type[now] == 1)
{
vector<int> szz;
for (int i:G2[now])
{
if (parr[now] == i)
{
szz.push_back(n_cid[cid] - subtree_sz[now]);
}
else
{
szz.push_back(subtree_sz[i]);
}
}
LL tot=0,tot2=0;
//cout << "now = " << now << " : ";
for (int i:szz)
{
tot += i;
tot2 += i*1LL*i;
//cout << i << " ";
}
//assert((int)szz.size() <= 2);
//cout<<endl;
tott1[now] = tot;
tott2[now] = tot2;
}
for (int i:G2[now])
{
if (i != par)
{
dfs4(i,now,cid);
}
}
//cout << "now = " << now << " , subtree_sz = " << subtree_sz[now] << endl;
}
void dfs3(int now,int par,int cid)
{
//cout << "now = " << now << " , par = " << par << endl;
vis[now] = true;
if (type[now] == 2)
{
//cout << "now = " << now << endl;
//cut vertex
for (int i:G2[now])
{
ans += (sz[i]*1LL*(sz[i]-1));
//cout << "ans = " << ans << endl;
}
//two different
vector<int> szz;
for (int i:G2[now])
{
if (parr[now] == i)
{
szz.push_back(n_cid[cid] - subtree_sz[now]);
}
else
{
szz.push_back(subtree_sz[i]);
}
}
LL tot=0,tot2=0;
for (int i:szz)
{
tot += i;
tot2 += i*1LL*i;
}
ans += (tot*tot-tot2);
for (int i:G2[now])
{
int del_sz = -1;
assert(type[i] == 1);
if (parr[now] == i)
{
del_sz = subtree_sz[now];
}
else
{
del_sz = (n_cid[cid] - subtree_sz[i]);
}
LL tottt1 = tott1[i] - del_sz;
LL tottt2 = tott2[i] - del_sz*1LL*del_sz;
//cout << "i = " << i << " , now = " << now << " , del_Sz = " << del_sz << " , tott1 = " << tott1[i] << " , tott2 = " <<tott2[i] << endl;
ans += (tottt1*tottt1) - tottt2;
ans += 2*(sz[i])*(tottt1);
//cout << "i = " << i << " , now = "<< now << " , del_sz = " << del_sz << " , tmp = " << (tot1*tot1) - tot2 << endl;
}
//cout << "ans = " << ans << endl;
}
else if (type[now] == 1)
{
//cout << "now = " << now << " , sz = " << sz[now] << " , n = " << n_cid[cid] << endl;
ans += (sz[now]*1LL*(sz[now]-1)*1LL*(sz[now]-2));
ans += 2*(sz[now]*1LL*(sz[now]-1)*1LL*(n_cid[cid]-sz[now]));
vector<int> szz;
for (int i:G2[now])
{
if (parr[now] == i)
{
szz.push_back(n_cid[cid] - subtree_sz[now]);
}
else
{
szz.push_back(subtree_sz[i]);
}
}
LL tot=0,tot2=0;
for (int i:szz)
{
tot += i;
tot2 += i*1LL*i;
}
ans += sz[now]*(tot*tot-tot2);
}
for (int i:G2[now])
{
if (i != par)
{
dfs3(i,now,cid);
}
}
}
int main ()
{
scanf("%d %d",&n,&m);
for (int i=1;i<=m;++i)
{
int x,y;
scanf("%d %d",&x,&y);
e[i] = (x^y);
G[x].push_back(i);
G[y].push_back(i);
xx[i] = x;
yy[i] = y;
}
for (int i=1;i<=n;++i)
{
if (!vis[i])
{
dfs(i,i);
}
}
/*for (int i=1;bcc_no>=i;i++)
{
cout << "i = " << i << " : ";
for (int j:bcc[i]) cout << j << ' ';
cout << endl;
}*/
for (int i=1;i<=bcc_no;++i)
{
++vis_id;
vector<int> v;
for (int j:bcc[i])
{
if (vis2[ xx[j] ] != vis_id)
{
v.push_back(xx[j]);
vis2[ xx[j] ] = vis_id;
}
if (vis2[ yy[j] ] != vis_id)
{
v.push_back(yy[j]);
vis2[ yy[j] ] = vis_id;
}
}
for (int j:v)
{
cnt[j]++;
}
vv[i] = v;
}
int vid = n;
for (int i=1;i<=bcc_no;++i)
{
++vid;
type[vid] = 1;
for (int j:vv[i])
{
if (cnt[j] == 1)
{
sz[vid]++;
}
else
{
G2[vid].push_back(j);
G2[j].push_back(vid);
type[j] = 2;
sz[j] = 1;
}
}
}
int cid=0;
memset(vis,0,sizeof(vis));
for (int i=n+1;i <= vid;++i)
{
if (!vis[i])
{
dfs2(i,i,++cid);
}
}
memset(vis,0,sizeof(vis));
cid=0;
for (int i=n+1;i<=vid;++i)
{
if (!vis[i])
{
dfs4(i,i,++cid);
}
}
memset(vis,0,sizeof(vis));
cid=0;
for (int i=n+1;i<=vid;++i)
{
if (!vis[i])
{
dfs3(i,i,++cid);
}
}
printf("%lld\n",ans);
}
Compilation message
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:228:10: 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:232:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&x,&y);
~~~~~^~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
76408 KB |
Output is correct |
2 |
Correct |
75 ms |
76428 KB |
Output is correct |
3 |
Correct |
68 ms |
76564 KB |
Output is correct |
4 |
Correct |
69 ms |
76564 KB |
Output is correct |
5 |
Correct |
63 ms |
76564 KB |
Output is correct |
6 |
Correct |
75 ms |
76564 KB |
Output is correct |
7 |
Correct |
65 ms |
76588 KB |
Output is correct |
8 |
Correct |
67 ms |
76644 KB |
Output is correct |
9 |
Correct |
76 ms |
76648 KB |
Output is correct |
10 |
Correct |
80 ms |
76652 KB |
Output is correct |
11 |
Correct |
72 ms |
76672 KB |
Output is correct |
12 |
Correct |
64 ms |
76672 KB |
Output is correct |
13 |
Correct |
64 ms |
76672 KB |
Output is correct |
14 |
Correct |
66 ms |
76672 KB |
Output is correct |
15 |
Correct |
66 ms |
76708 KB |
Output is correct |
16 |
Correct |
63 ms |
76708 KB |
Output is correct |
17 |
Correct |
66 ms |
76708 KB |
Output is correct |
18 |
Correct |
66 ms |
76708 KB |
Output is correct |
19 |
Correct |
71 ms |
76708 KB |
Output is correct |
20 |
Correct |
79 ms |
76708 KB |
Output is correct |
21 |
Correct |
64 ms |
76708 KB |
Output is correct |
22 |
Correct |
64 ms |
76708 KB |
Output is correct |
23 |
Correct |
64 ms |
76708 KB |
Output is correct |
24 |
Correct |
67 ms |
76708 KB |
Output is correct |
25 |
Correct |
62 ms |
76708 KB |
Output is correct |
26 |
Correct |
64 ms |
76708 KB |
Output is correct |
27 |
Correct |
64 ms |
76708 KB |
Output is correct |
28 |
Correct |
68 ms |
76708 KB |
Output is correct |
29 |
Correct |
67 ms |
76708 KB |
Output is correct |
30 |
Correct |
68 ms |
76708 KB |
Output is correct |
31 |
Correct |
63 ms |
76708 KB |
Output is correct |
32 |
Correct |
68 ms |
76708 KB |
Output is correct |
33 |
Correct |
64 ms |
76708 KB |
Output is correct |
34 |
Correct |
66 ms |
76708 KB |
Output is correct |
35 |
Correct |
65 ms |
76708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
76408 KB |
Output is correct |
2 |
Correct |
75 ms |
76428 KB |
Output is correct |
3 |
Correct |
68 ms |
76564 KB |
Output is correct |
4 |
Correct |
69 ms |
76564 KB |
Output is correct |
5 |
Correct |
63 ms |
76564 KB |
Output is correct |
6 |
Correct |
75 ms |
76564 KB |
Output is correct |
7 |
Correct |
65 ms |
76588 KB |
Output is correct |
8 |
Correct |
67 ms |
76644 KB |
Output is correct |
9 |
Correct |
76 ms |
76648 KB |
Output is correct |
10 |
Correct |
80 ms |
76652 KB |
Output is correct |
11 |
Correct |
72 ms |
76672 KB |
Output is correct |
12 |
Correct |
64 ms |
76672 KB |
Output is correct |
13 |
Correct |
64 ms |
76672 KB |
Output is correct |
14 |
Correct |
66 ms |
76672 KB |
Output is correct |
15 |
Correct |
66 ms |
76708 KB |
Output is correct |
16 |
Correct |
63 ms |
76708 KB |
Output is correct |
17 |
Correct |
66 ms |
76708 KB |
Output is correct |
18 |
Correct |
66 ms |
76708 KB |
Output is correct |
19 |
Correct |
71 ms |
76708 KB |
Output is correct |
20 |
Correct |
79 ms |
76708 KB |
Output is correct |
21 |
Correct |
64 ms |
76708 KB |
Output is correct |
22 |
Correct |
64 ms |
76708 KB |
Output is correct |
23 |
Correct |
64 ms |
76708 KB |
Output is correct |
24 |
Correct |
67 ms |
76708 KB |
Output is correct |
25 |
Correct |
62 ms |
76708 KB |
Output is correct |
26 |
Correct |
64 ms |
76708 KB |
Output is correct |
27 |
Correct |
64 ms |
76708 KB |
Output is correct |
28 |
Correct |
68 ms |
76708 KB |
Output is correct |
29 |
Correct |
67 ms |
76708 KB |
Output is correct |
30 |
Correct |
68 ms |
76708 KB |
Output is correct |
31 |
Correct |
63 ms |
76708 KB |
Output is correct |
32 |
Correct |
68 ms |
76708 KB |
Output is correct |
33 |
Correct |
64 ms |
76708 KB |
Output is correct |
34 |
Correct |
66 ms |
76708 KB |
Output is correct |
35 |
Correct |
65 ms |
76708 KB |
Output is correct |
36 |
Correct |
63 ms |
76708 KB |
Output is correct |
37 |
Correct |
63 ms |
76708 KB |
Output is correct |
38 |
Correct |
65 ms |
76708 KB |
Output is correct |
39 |
Correct |
66 ms |
76708 KB |
Output is correct |
40 |
Correct |
63 ms |
76708 KB |
Output is correct |
41 |
Correct |
65 ms |
76708 KB |
Output is correct |
42 |
Correct |
69 ms |
76708 KB |
Output is correct |
43 |
Correct |
66 ms |
76796 KB |
Output is correct |
44 |
Correct |
64 ms |
76796 KB |
Output is correct |
45 |
Correct |
66 ms |
76796 KB |
Output is correct |
46 |
Correct |
63 ms |
76796 KB |
Output is correct |
47 |
Correct |
68 ms |
76796 KB |
Output is correct |
48 |
Correct |
63 ms |
76796 KB |
Output is correct |
49 |
Correct |
68 ms |
76796 KB |
Output is correct |
50 |
Correct |
68 ms |
76796 KB |
Output is correct |
51 |
Correct |
67 ms |
76796 KB |
Output is correct |
52 |
Correct |
64 ms |
76796 KB |
Output is correct |
53 |
Correct |
66 ms |
76796 KB |
Output is correct |
54 |
Correct |
63 ms |
76796 KB |
Output is correct |
55 |
Correct |
63 ms |
76796 KB |
Output is correct |
56 |
Correct |
66 ms |
76796 KB |
Output is correct |
57 |
Correct |
65 ms |
76796 KB |
Output is correct |
58 |
Correct |
64 ms |
76796 KB |
Output is correct |
59 |
Correct |
63 ms |
76796 KB |
Output is correct |
60 |
Correct |
63 ms |
76796 KB |
Output is correct |
61 |
Correct |
64 ms |
76796 KB |
Output is correct |
62 |
Correct |
64 ms |
76796 KB |
Output is correct |
63 |
Correct |
75 ms |
76796 KB |
Output is correct |
64 |
Correct |
68 ms |
76796 KB |
Output is correct |
65 |
Correct |
63 ms |
76796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
162 ms |
92968 KB |
Output is correct |
2 |
Correct |
174 ms |
92968 KB |
Output is correct |
3 |
Correct |
263 ms |
104640 KB |
Output is correct |
4 |
Correct |
232 ms |
104640 KB |
Output is correct |
5 |
Correct |
272 ms |
104640 KB |
Output is correct |
6 |
Correct |
288 ms |
106864 KB |
Output is correct |
7 |
Correct |
284 ms |
106864 KB |
Output is correct |
8 |
Correct |
285 ms |
106864 KB |
Output is correct |
9 |
Correct |
269 ms |
106864 KB |
Output is correct |
10 |
Correct |
279 ms |
106864 KB |
Output is correct |
11 |
Correct |
210 ms |
106864 KB |
Output is correct |
12 |
Correct |
193 ms |
106864 KB |
Output is correct |
13 |
Correct |
178 ms |
106864 KB |
Output is correct |
14 |
Correct |
205 ms |
106864 KB |
Output is correct |
15 |
Correct |
178 ms |
106864 KB |
Output is correct |
16 |
Correct |
150 ms |
106864 KB |
Output is correct |
17 |
Correct |
67 ms |
106864 KB |
Output is correct |
18 |
Correct |
68 ms |
106864 KB |
Output is correct |
19 |
Correct |
82 ms |
106864 KB |
Output is correct |
20 |
Correct |
67 ms |
106864 KB |
Output is correct |
21 |
Correct |
69 ms |
106864 KB |
Output is correct |
22 |
Correct |
68 ms |
106864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
66 ms |
106864 KB |
Output is correct |
2 |
Correct |
65 ms |
106864 KB |
Output is correct |
3 |
Correct |
65 ms |
106864 KB |
Output is correct |
4 |
Correct |
65 ms |
106864 KB |
Output is correct |
5 |
Correct |
66 ms |
106864 KB |
Output is correct |
6 |
Correct |
64 ms |
106864 KB |
Output is correct |
7 |
Correct |
65 ms |
106864 KB |
Output is correct |
8 |
Correct |
66 ms |
106864 KB |
Output is correct |
9 |
Correct |
65 ms |
106864 KB |
Output is correct |
10 |
Correct |
66 ms |
106864 KB |
Output is correct |
11 |
Correct |
66 ms |
106864 KB |
Output is correct |
12 |
Correct |
67 ms |
106864 KB |
Output is correct |
13 |
Correct |
68 ms |
106864 KB |
Output is correct |
14 |
Correct |
66 ms |
106864 KB |
Output is correct |
15 |
Correct |
74 ms |
106864 KB |
Output is correct |
16 |
Correct |
81 ms |
106864 KB |
Output is correct |
17 |
Correct |
65 ms |
106864 KB |
Output is correct |
18 |
Correct |
65 ms |
106864 KB |
Output is correct |
19 |
Correct |
64 ms |
106864 KB |
Output is correct |
20 |
Correct |
69 ms |
106864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
332 ms |
106864 KB |
Output is correct |
2 |
Correct |
335 ms |
106864 KB |
Output is correct |
3 |
Correct |
346 ms |
106864 KB |
Output is correct |
4 |
Correct |
335 ms |
106864 KB |
Output is correct |
5 |
Correct |
326 ms |
106864 KB |
Output is correct |
6 |
Correct |
433 ms |
124520 KB |
Output is correct |
7 |
Correct |
459 ms |
124520 KB |
Output is correct |
8 |
Correct |
409 ms |
124520 KB |
Output is correct |
9 |
Correct |
449 ms |
124520 KB |
Output is correct |
10 |
Correct |
291 ms |
124520 KB |
Output is correct |
11 |
Correct |
378 ms |
124520 KB |
Output is correct |
12 |
Correct |
345 ms |
124520 KB |
Output is correct |
13 |
Correct |
387 ms |
124520 KB |
Output is correct |
14 |
Correct |
267 ms |
124520 KB |
Output is correct |
15 |
Correct |
257 ms |
124520 KB |
Output is correct |
16 |
Correct |
164 ms |
124520 KB |
Output is correct |
17 |
Correct |
185 ms |
124520 KB |
Output is correct |
18 |
Correct |
190 ms |
124520 KB |
Output is correct |
19 |
Correct |
200 ms |
124520 KB |
Output is correct |
20 |
Correct |
226 ms |
124520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
67 ms |
124520 KB |
Output is correct |
2 |
Correct |
66 ms |
124520 KB |
Output is correct |
3 |
Correct |
67 ms |
124520 KB |
Output is correct |
4 |
Correct |
68 ms |
124520 KB |
Output is correct |
5 |
Correct |
66 ms |
124520 KB |
Output is correct |
6 |
Correct |
66 ms |
124520 KB |
Output is correct |
7 |
Correct |
69 ms |
124520 KB |
Output is correct |
8 |
Correct |
67 ms |
124520 KB |
Output is correct |
9 |
Correct |
67 ms |
124520 KB |
Output is correct |
10 |
Correct |
71 ms |
124520 KB |
Output is correct |
11 |
Correct |
72 ms |
124520 KB |
Output is correct |
12 |
Correct |
68 ms |
124520 KB |
Output is correct |
13 |
Correct |
75 ms |
124520 KB |
Output is correct |
14 |
Correct |
75 ms |
124520 KB |
Output is correct |
15 |
Correct |
71 ms |
124520 KB |
Output is correct |
16 |
Correct |
72 ms |
124520 KB |
Output is correct |
17 |
Correct |
75 ms |
124520 KB |
Output is correct |
18 |
Correct |
78 ms |
124520 KB |
Output is correct |
19 |
Correct |
67 ms |
124520 KB |
Output is correct |
20 |
Correct |
68 ms |
124520 KB |
Output is correct |
21 |
Correct |
72 ms |
124520 KB |
Output is correct |
22 |
Correct |
76 ms |
124520 KB |
Output is correct |
23 |
Correct |
70 ms |
124520 KB |
Output is correct |
24 |
Correct |
70 ms |
124520 KB |
Output is correct |
25 |
Correct |
65 ms |
124520 KB |
Output is correct |
26 |
Correct |
68 ms |
124520 KB |
Output is correct |
27 |
Correct |
68 ms |
124520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
327 ms |
124520 KB |
Output is correct |
2 |
Correct |
348 ms |
124520 KB |
Output is correct |
3 |
Correct |
481 ms |
124520 KB |
Output is correct |
4 |
Correct |
327 ms |
124520 KB |
Output is correct |
5 |
Correct |
277 ms |
124520 KB |
Output is correct |
6 |
Correct |
234 ms |
124520 KB |
Output is correct |
7 |
Correct |
218 ms |
124520 KB |
Output is correct |
8 |
Correct |
195 ms |
124520 KB |
Output is correct |
9 |
Correct |
197 ms |
124520 KB |
Output is correct |
10 |
Correct |
202 ms |
124520 KB |
Output is correct |
11 |
Correct |
196 ms |
124520 KB |
Output is correct |
12 |
Correct |
169 ms |
124520 KB |
Output is correct |
13 |
Correct |
161 ms |
124520 KB |
Output is correct |
14 |
Correct |
160 ms |
124520 KB |
Output is correct |
15 |
Correct |
368 ms |
124520 KB |
Output is correct |
16 |
Correct |
384 ms |
124520 KB |
Output is correct |
17 |
Correct |
382 ms |
124520 KB |
Output is correct |
18 |
Correct |
321 ms |
124520 KB |
Output is correct |
19 |
Correct |
289 ms |
124520 KB |
Output is correct |
20 |
Correct |
298 ms |
124520 KB |
Output is correct |
21 |
Correct |
318 ms |
124520 KB |
Output is correct |
22 |
Correct |
249 ms |
124520 KB |
Output is correct |
23 |
Correct |
206 ms |
124520 KB |
Output is correct |
24 |
Correct |
297 ms |
124520 KB |
Output is correct |
25 |
Correct |
354 ms |
124520 KB |
Output is correct |
26 |
Correct |
289 ms |
124520 KB |
Output is correct |
27 |
Correct |
304 ms |
124520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
76408 KB |
Output is correct |
2 |
Correct |
75 ms |
76428 KB |
Output is correct |
3 |
Correct |
68 ms |
76564 KB |
Output is correct |
4 |
Correct |
69 ms |
76564 KB |
Output is correct |
5 |
Correct |
63 ms |
76564 KB |
Output is correct |
6 |
Correct |
75 ms |
76564 KB |
Output is correct |
7 |
Correct |
65 ms |
76588 KB |
Output is correct |
8 |
Correct |
67 ms |
76644 KB |
Output is correct |
9 |
Correct |
76 ms |
76648 KB |
Output is correct |
10 |
Correct |
80 ms |
76652 KB |
Output is correct |
11 |
Correct |
72 ms |
76672 KB |
Output is correct |
12 |
Correct |
64 ms |
76672 KB |
Output is correct |
13 |
Correct |
64 ms |
76672 KB |
Output is correct |
14 |
Correct |
66 ms |
76672 KB |
Output is correct |
15 |
Correct |
66 ms |
76708 KB |
Output is correct |
16 |
Correct |
63 ms |
76708 KB |
Output is correct |
17 |
Correct |
66 ms |
76708 KB |
Output is correct |
18 |
Correct |
66 ms |
76708 KB |
Output is correct |
19 |
Correct |
71 ms |
76708 KB |
Output is correct |
20 |
Correct |
79 ms |
76708 KB |
Output is correct |
21 |
Correct |
64 ms |
76708 KB |
Output is correct |
22 |
Correct |
64 ms |
76708 KB |
Output is correct |
23 |
Correct |
64 ms |
76708 KB |
Output is correct |
24 |
Correct |
67 ms |
76708 KB |
Output is correct |
25 |
Correct |
62 ms |
76708 KB |
Output is correct |
26 |
Correct |
64 ms |
76708 KB |
Output is correct |
27 |
Correct |
64 ms |
76708 KB |
Output is correct |
28 |
Correct |
68 ms |
76708 KB |
Output is correct |
29 |
Correct |
67 ms |
76708 KB |
Output is correct |
30 |
Correct |
68 ms |
76708 KB |
Output is correct |
31 |
Correct |
63 ms |
76708 KB |
Output is correct |
32 |
Correct |
68 ms |
76708 KB |
Output is correct |
33 |
Correct |
64 ms |
76708 KB |
Output is correct |
34 |
Correct |
66 ms |
76708 KB |
Output is correct |
35 |
Correct |
65 ms |
76708 KB |
Output is correct |
36 |
Correct |
63 ms |
76708 KB |
Output is correct |
37 |
Correct |
63 ms |
76708 KB |
Output is correct |
38 |
Correct |
65 ms |
76708 KB |
Output is correct |
39 |
Correct |
66 ms |
76708 KB |
Output is correct |
40 |
Correct |
63 ms |
76708 KB |
Output is correct |
41 |
Correct |
65 ms |
76708 KB |
Output is correct |
42 |
Correct |
69 ms |
76708 KB |
Output is correct |
43 |
Correct |
66 ms |
76796 KB |
Output is correct |
44 |
Correct |
64 ms |
76796 KB |
Output is correct |
45 |
Correct |
66 ms |
76796 KB |
Output is correct |
46 |
Correct |
63 ms |
76796 KB |
Output is correct |
47 |
Correct |
68 ms |
76796 KB |
Output is correct |
48 |
Correct |
63 ms |
76796 KB |
Output is correct |
49 |
Correct |
68 ms |
76796 KB |
Output is correct |
50 |
Correct |
68 ms |
76796 KB |
Output is correct |
51 |
Correct |
67 ms |
76796 KB |
Output is correct |
52 |
Correct |
64 ms |
76796 KB |
Output is correct |
53 |
Correct |
66 ms |
76796 KB |
Output is correct |
54 |
Correct |
63 ms |
76796 KB |
Output is correct |
55 |
Correct |
63 ms |
76796 KB |
Output is correct |
56 |
Correct |
66 ms |
76796 KB |
Output is correct |
57 |
Correct |
65 ms |
76796 KB |
Output is correct |
58 |
Correct |
64 ms |
76796 KB |
Output is correct |
59 |
Correct |
63 ms |
76796 KB |
Output is correct |
60 |
Correct |
63 ms |
76796 KB |
Output is correct |
61 |
Correct |
64 ms |
76796 KB |
Output is correct |
62 |
Correct |
64 ms |
76796 KB |
Output is correct |
63 |
Correct |
75 ms |
76796 KB |
Output is correct |
64 |
Correct |
68 ms |
76796 KB |
Output is correct |
65 |
Correct |
63 ms |
76796 KB |
Output is correct |
66 |
Correct |
69 ms |
124520 KB |
Output is correct |
67 |
Correct |
69 ms |
124520 KB |
Output is correct |
68 |
Correct |
72 ms |
124520 KB |
Output is correct |
69 |
Correct |
67 ms |
124520 KB |
Output is correct |
70 |
Correct |
77 ms |
124520 KB |
Output is correct |
71 |
Correct |
70 ms |
124520 KB |
Output is correct |
72 |
Correct |
65 ms |
124520 KB |
Output is correct |
73 |
Correct |
65 ms |
124520 KB |
Output is correct |
74 |
Correct |
65 ms |
124520 KB |
Output is correct |
75 |
Correct |
66 ms |
124520 KB |
Output is correct |
76 |
Correct |
64 ms |
124520 KB |
Output is correct |
77 |
Correct |
68 ms |
124520 KB |
Output is correct |
78 |
Correct |
69 ms |
124520 KB |
Output is correct |
79 |
Correct |
68 ms |
124520 KB |
Output is correct |
80 |
Correct |
71 ms |
124520 KB |
Output is correct |
81 |
Correct |
68 ms |
124520 KB |
Output is correct |
82 |
Correct |
66 ms |
124520 KB |
Output is correct |
83 |
Correct |
69 ms |
124520 KB |
Output is correct |
84 |
Correct |
65 ms |
124520 KB |
Output is correct |
85 |
Correct |
72 ms |
124520 KB |
Output is correct |
86 |
Correct |
67 ms |
124520 KB |
Output is correct |
87 |
Correct |
73 ms |
124520 KB |
Output is correct |
88 |
Correct |
66 ms |
124520 KB |
Output is correct |
89 |
Correct |
70 ms |
124520 KB |
Output is correct |
90 |
Correct |
67 ms |
124520 KB |
Output is correct |
91 |
Correct |
64 ms |
124520 KB |
Output is correct |
92 |
Correct |
66 ms |
124520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
76408 KB |
Output is correct |
2 |
Correct |
75 ms |
76428 KB |
Output is correct |
3 |
Correct |
68 ms |
76564 KB |
Output is correct |
4 |
Correct |
69 ms |
76564 KB |
Output is correct |
5 |
Correct |
63 ms |
76564 KB |
Output is correct |
6 |
Correct |
75 ms |
76564 KB |
Output is correct |
7 |
Correct |
65 ms |
76588 KB |
Output is correct |
8 |
Correct |
67 ms |
76644 KB |
Output is correct |
9 |
Correct |
76 ms |
76648 KB |
Output is correct |
10 |
Correct |
80 ms |
76652 KB |
Output is correct |
11 |
Correct |
72 ms |
76672 KB |
Output is correct |
12 |
Correct |
64 ms |
76672 KB |
Output is correct |
13 |
Correct |
64 ms |
76672 KB |
Output is correct |
14 |
Correct |
66 ms |
76672 KB |
Output is correct |
15 |
Correct |
66 ms |
76708 KB |
Output is correct |
16 |
Correct |
63 ms |
76708 KB |
Output is correct |
17 |
Correct |
66 ms |
76708 KB |
Output is correct |
18 |
Correct |
66 ms |
76708 KB |
Output is correct |
19 |
Correct |
71 ms |
76708 KB |
Output is correct |
20 |
Correct |
79 ms |
76708 KB |
Output is correct |
21 |
Correct |
64 ms |
76708 KB |
Output is correct |
22 |
Correct |
64 ms |
76708 KB |
Output is correct |
23 |
Correct |
64 ms |
76708 KB |
Output is correct |
24 |
Correct |
67 ms |
76708 KB |
Output is correct |
25 |
Correct |
62 ms |
76708 KB |
Output is correct |
26 |
Correct |
64 ms |
76708 KB |
Output is correct |
27 |
Correct |
64 ms |
76708 KB |
Output is correct |
28 |
Correct |
68 ms |
76708 KB |
Output is correct |
29 |
Correct |
67 ms |
76708 KB |
Output is correct |
30 |
Correct |
68 ms |
76708 KB |
Output is correct |
31 |
Correct |
63 ms |
76708 KB |
Output is correct |
32 |
Correct |
68 ms |
76708 KB |
Output is correct |
33 |
Correct |
64 ms |
76708 KB |
Output is correct |
34 |
Correct |
66 ms |
76708 KB |
Output is correct |
35 |
Correct |
65 ms |
76708 KB |
Output is correct |
36 |
Correct |
63 ms |
76708 KB |
Output is correct |
37 |
Correct |
63 ms |
76708 KB |
Output is correct |
38 |
Correct |
65 ms |
76708 KB |
Output is correct |
39 |
Correct |
66 ms |
76708 KB |
Output is correct |
40 |
Correct |
63 ms |
76708 KB |
Output is correct |
41 |
Correct |
65 ms |
76708 KB |
Output is correct |
42 |
Correct |
69 ms |
76708 KB |
Output is correct |
43 |
Correct |
66 ms |
76796 KB |
Output is correct |
44 |
Correct |
64 ms |
76796 KB |
Output is correct |
45 |
Correct |
66 ms |
76796 KB |
Output is correct |
46 |
Correct |
63 ms |
76796 KB |
Output is correct |
47 |
Correct |
68 ms |
76796 KB |
Output is correct |
48 |
Correct |
63 ms |
76796 KB |
Output is correct |
49 |
Correct |
68 ms |
76796 KB |
Output is correct |
50 |
Correct |
68 ms |
76796 KB |
Output is correct |
51 |
Correct |
67 ms |
76796 KB |
Output is correct |
52 |
Correct |
64 ms |
76796 KB |
Output is correct |
53 |
Correct |
66 ms |
76796 KB |
Output is correct |
54 |
Correct |
63 ms |
76796 KB |
Output is correct |
55 |
Correct |
63 ms |
76796 KB |
Output is correct |
56 |
Correct |
66 ms |
76796 KB |
Output is correct |
57 |
Correct |
65 ms |
76796 KB |
Output is correct |
58 |
Correct |
64 ms |
76796 KB |
Output is correct |
59 |
Correct |
63 ms |
76796 KB |
Output is correct |
60 |
Correct |
63 ms |
76796 KB |
Output is correct |
61 |
Correct |
64 ms |
76796 KB |
Output is correct |
62 |
Correct |
64 ms |
76796 KB |
Output is correct |
63 |
Correct |
75 ms |
76796 KB |
Output is correct |
64 |
Correct |
68 ms |
76796 KB |
Output is correct |
65 |
Correct |
63 ms |
76796 KB |
Output is correct |
66 |
Correct |
162 ms |
92968 KB |
Output is correct |
67 |
Correct |
174 ms |
92968 KB |
Output is correct |
68 |
Correct |
263 ms |
104640 KB |
Output is correct |
69 |
Correct |
232 ms |
104640 KB |
Output is correct |
70 |
Correct |
272 ms |
104640 KB |
Output is correct |
71 |
Correct |
288 ms |
106864 KB |
Output is correct |
72 |
Correct |
284 ms |
106864 KB |
Output is correct |
73 |
Correct |
285 ms |
106864 KB |
Output is correct |
74 |
Correct |
269 ms |
106864 KB |
Output is correct |
75 |
Correct |
279 ms |
106864 KB |
Output is correct |
76 |
Correct |
210 ms |
106864 KB |
Output is correct |
77 |
Correct |
193 ms |
106864 KB |
Output is correct |
78 |
Correct |
178 ms |
106864 KB |
Output is correct |
79 |
Correct |
205 ms |
106864 KB |
Output is correct |
80 |
Correct |
178 ms |
106864 KB |
Output is correct |
81 |
Correct |
150 ms |
106864 KB |
Output is correct |
82 |
Correct |
67 ms |
106864 KB |
Output is correct |
83 |
Correct |
68 ms |
106864 KB |
Output is correct |
84 |
Correct |
82 ms |
106864 KB |
Output is correct |
85 |
Correct |
67 ms |
106864 KB |
Output is correct |
86 |
Correct |
69 ms |
106864 KB |
Output is correct |
87 |
Correct |
68 ms |
106864 KB |
Output is correct |
88 |
Correct |
66 ms |
106864 KB |
Output is correct |
89 |
Correct |
65 ms |
106864 KB |
Output is correct |
90 |
Correct |
65 ms |
106864 KB |
Output is correct |
91 |
Correct |
65 ms |
106864 KB |
Output is correct |
92 |
Correct |
66 ms |
106864 KB |
Output is correct |
93 |
Correct |
64 ms |
106864 KB |
Output is correct |
94 |
Correct |
65 ms |
106864 KB |
Output is correct |
95 |
Correct |
66 ms |
106864 KB |
Output is correct |
96 |
Correct |
65 ms |
106864 KB |
Output is correct |
97 |
Correct |
66 ms |
106864 KB |
Output is correct |
98 |
Correct |
66 ms |
106864 KB |
Output is correct |
99 |
Correct |
67 ms |
106864 KB |
Output is correct |
100 |
Correct |
68 ms |
106864 KB |
Output is correct |
101 |
Correct |
66 ms |
106864 KB |
Output is correct |
102 |
Correct |
74 ms |
106864 KB |
Output is correct |
103 |
Correct |
81 ms |
106864 KB |
Output is correct |
104 |
Correct |
65 ms |
106864 KB |
Output is correct |
105 |
Correct |
65 ms |
106864 KB |
Output is correct |
106 |
Correct |
64 ms |
106864 KB |
Output is correct |
107 |
Correct |
69 ms |
106864 KB |
Output is correct |
108 |
Correct |
332 ms |
106864 KB |
Output is correct |
109 |
Correct |
335 ms |
106864 KB |
Output is correct |
110 |
Correct |
346 ms |
106864 KB |
Output is correct |
111 |
Correct |
335 ms |
106864 KB |
Output is correct |
112 |
Correct |
326 ms |
106864 KB |
Output is correct |
113 |
Correct |
433 ms |
124520 KB |
Output is correct |
114 |
Correct |
459 ms |
124520 KB |
Output is correct |
115 |
Correct |
409 ms |
124520 KB |
Output is correct |
116 |
Correct |
449 ms |
124520 KB |
Output is correct |
117 |
Correct |
291 ms |
124520 KB |
Output is correct |
118 |
Correct |
378 ms |
124520 KB |
Output is correct |
119 |
Correct |
345 ms |
124520 KB |
Output is correct |
120 |
Correct |
387 ms |
124520 KB |
Output is correct |
121 |
Correct |
267 ms |
124520 KB |
Output is correct |
122 |
Correct |
257 ms |
124520 KB |
Output is correct |
123 |
Correct |
164 ms |
124520 KB |
Output is correct |
124 |
Correct |
185 ms |
124520 KB |
Output is correct |
125 |
Correct |
190 ms |
124520 KB |
Output is correct |
126 |
Correct |
200 ms |
124520 KB |
Output is correct |
127 |
Correct |
226 ms |
124520 KB |
Output is correct |
128 |
Correct |
67 ms |
124520 KB |
Output is correct |
129 |
Correct |
66 ms |
124520 KB |
Output is correct |
130 |
Correct |
67 ms |
124520 KB |
Output is correct |
131 |
Correct |
68 ms |
124520 KB |
Output is correct |
132 |
Correct |
66 ms |
124520 KB |
Output is correct |
133 |
Correct |
66 ms |
124520 KB |
Output is correct |
134 |
Correct |
69 ms |
124520 KB |
Output is correct |
135 |
Correct |
67 ms |
124520 KB |
Output is correct |
136 |
Correct |
67 ms |
124520 KB |
Output is correct |
137 |
Correct |
71 ms |
124520 KB |
Output is correct |
138 |
Correct |
72 ms |
124520 KB |
Output is correct |
139 |
Correct |
68 ms |
124520 KB |
Output is correct |
140 |
Correct |
75 ms |
124520 KB |
Output is correct |
141 |
Correct |
75 ms |
124520 KB |
Output is correct |
142 |
Correct |
71 ms |
124520 KB |
Output is correct |
143 |
Correct |
72 ms |
124520 KB |
Output is correct |
144 |
Correct |
75 ms |
124520 KB |
Output is correct |
145 |
Correct |
78 ms |
124520 KB |
Output is correct |
146 |
Correct |
67 ms |
124520 KB |
Output is correct |
147 |
Correct |
68 ms |
124520 KB |
Output is correct |
148 |
Correct |
72 ms |
124520 KB |
Output is correct |
149 |
Correct |
76 ms |
124520 KB |
Output is correct |
150 |
Correct |
70 ms |
124520 KB |
Output is correct |
151 |
Correct |
70 ms |
124520 KB |
Output is correct |
152 |
Correct |
65 ms |
124520 KB |
Output is correct |
153 |
Correct |
68 ms |
124520 KB |
Output is correct |
154 |
Correct |
68 ms |
124520 KB |
Output is correct |
155 |
Correct |
327 ms |
124520 KB |
Output is correct |
156 |
Correct |
348 ms |
124520 KB |
Output is correct |
157 |
Correct |
481 ms |
124520 KB |
Output is correct |
158 |
Correct |
327 ms |
124520 KB |
Output is correct |
159 |
Correct |
277 ms |
124520 KB |
Output is correct |
160 |
Correct |
234 ms |
124520 KB |
Output is correct |
161 |
Correct |
218 ms |
124520 KB |
Output is correct |
162 |
Correct |
195 ms |
124520 KB |
Output is correct |
163 |
Correct |
197 ms |
124520 KB |
Output is correct |
164 |
Correct |
202 ms |
124520 KB |
Output is correct |
165 |
Correct |
196 ms |
124520 KB |
Output is correct |
166 |
Correct |
169 ms |
124520 KB |
Output is correct |
167 |
Correct |
161 ms |
124520 KB |
Output is correct |
168 |
Correct |
160 ms |
124520 KB |
Output is correct |
169 |
Correct |
368 ms |
124520 KB |
Output is correct |
170 |
Correct |
384 ms |
124520 KB |
Output is correct |
171 |
Correct |
382 ms |
124520 KB |
Output is correct |
172 |
Correct |
321 ms |
124520 KB |
Output is correct |
173 |
Correct |
289 ms |
124520 KB |
Output is correct |
174 |
Correct |
298 ms |
124520 KB |
Output is correct |
175 |
Correct |
318 ms |
124520 KB |
Output is correct |
176 |
Correct |
249 ms |
124520 KB |
Output is correct |
177 |
Correct |
206 ms |
124520 KB |
Output is correct |
178 |
Correct |
297 ms |
124520 KB |
Output is correct |
179 |
Correct |
354 ms |
124520 KB |
Output is correct |
180 |
Correct |
289 ms |
124520 KB |
Output is correct |
181 |
Correct |
304 ms |
124520 KB |
Output is correct |
182 |
Correct |
69 ms |
124520 KB |
Output is correct |
183 |
Correct |
69 ms |
124520 KB |
Output is correct |
184 |
Correct |
72 ms |
124520 KB |
Output is correct |
185 |
Correct |
67 ms |
124520 KB |
Output is correct |
186 |
Correct |
77 ms |
124520 KB |
Output is correct |
187 |
Correct |
70 ms |
124520 KB |
Output is correct |
188 |
Correct |
65 ms |
124520 KB |
Output is correct |
189 |
Correct |
65 ms |
124520 KB |
Output is correct |
190 |
Correct |
65 ms |
124520 KB |
Output is correct |
191 |
Correct |
66 ms |
124520 KB |
Output is correct |
192 |
Correct |
64 ms |
124520 KB |
Output is correct |
193 |
Correct |
68 ms |
124520 KB |
Output is correct |
194 |
Correct |
69 ms |
124520 KB |
Output is correct |
195 |
Correct |
68 ms |
124520 KB |
Output is correct |
196 |
Correct |
71 ms |
124520 KB |
Output is correct |
197 |
Correct |
68 ms |
124520 KB |
Output is correct |
198 |
Correct |
66 ms |
124520 KB |
Output is correct |
199 |
Correct |
69 ms |
124520 KB |
Output is correct |
200 |
Correct |
65 ms |
124520 KB |
Output is correct |
201 |
Correct |
72 ms |
124520 KB |
Output is correct |
202 |
Correct |
67 ms |
124520 KB |
Output is correct |
203 |
Correct |
73 ms |
124520 KB |
Output is correct |
204 |
Correct |
66 ms |
124520 KB |
Output is correct |
205 |
Correct |
70 ms |
124520 KB |
Output is correct |
206 |
Correct |
67 ms |
124520 KB |
Output is correct |
207 |
Correct |
64 ms |
124520 KB |
Output is correct |
208 |
Correct |
66 ms |
124520 KB |
Output is correct |
209 |
Correct |
65 ms |
124520 KB |
Output is correct |
210 |
Correct |
251 ms |
124520 KB |
Output is correct |
211 |
Correct |
257 ms |
124520 KB |
Output is correct |
212 |
Correct |
248 ms |
124520 KB |
Output is correct |
213 |
Correct |
261 ms |
124520 KB |
Output is correct |
214 |
Correct |
159 ms |
124520 KB |
Output is correct |
215 |
Correct |
145 ms |
124520 KB |
Output is correct |
216 |
Correct |
341 ms |
124520 KB |
Output is correct |
217 |
Correct |
270 ms |
124520 KB |
Output is correct |
218 |
Correct |
214 ms |
124520 KB |
Output is correct |
219 |
Correct |
189 ms |
124520 KB |
Output is correct |
220 |
Correct |
180 ms |
124520 KB |
Output is correct |
221 |
Correct |
172 ms |
124520 KB |
Output is correct |
222 |
Correct |
188 ms |
124520 KB |
Output is correct |
223 |
Correct |
346 ms |
124520 KB |
Output is correct |
224 |
Correct |
277 ms |
124520 KB |
Output is correct |
225 |
Correct |
242 ms |
124520 KB |
Output is correct |
226 |
Correct |
285 ms |
124520 KB |
Output is correct |
227 |
Correct |
226 ms |
124520 KB |
Output is correct |
228 |
Correct |
204 ms |
124520 KB |
Output is correct |
229 |
Correct |
180 ms |
124520 KB |
Output is correct |
230 |
Correct |
286 ms |
124520 KB |
Output is correct |
231 |
Correct |
252 ms |
124520 KB |
Output is correct |