// ~ Be Name Khoda ~
#include <bits/stdc++.h>
//#pragma GCC optimize ("Ofast")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,O3")
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second
const int maxn = 1e6 + 10;
const int maxn5 = 5e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e18;
int n, h[maxn5], mn[maxn5], newid, num = 0;
ll ans = 0, have[maxn5], allgood[maxn5], sz[maxn5];
bool mark[maxn5];
vector <int> adj[maxn5], chil[maxn5], bladj[maxn5];
vector <ll> good[maxn5];
void dfs1(int v, int par = -1){
mark[v] = true;
num++;
mn[v] = h[v];
for(auto u : adj[v]){
if(!mark[u]){
h[u] = h[v] + 1;
dfs1(u, v);
mn[v] = min(mn[v], mn[u]);
chil[v].pb(u);
}
else if(u != par)
mn[v] = min(mn[v], h[u]);
}
}
void dfs2(int v, int cmpup = -1){
allgood[v] = num;
if(cmpup != -1){
bladj[v].pb(cmpup);
bladj[cmpup].pb(v);
allgood[cmpup] = allgood[v];
}
for(auto u : chil[v]){
if(mn[u] >= h[v]){
bladj[v].pb(newid);
bladj[newid].pb(v);
dfs2(u, newid++);
}
else
dfs2(u, cmpup);
}
}
void dfs3(int v){
mark[v] = true;
sz[v] = 0;
int idpar = -1;
good[v].resize(bladj[v].size());
for(int i = 0; i < bladj[v].size(); i++){
int u = bladj[v][i];
if(!mark[u]){
dfs3(u);
have[v] += sz[v] * sz[u];
sz[v] += sz[u];
good[v][i] = sz[u];
}
else
idpar = i;
}
have[v] += sz[v] * (allgood[v] - sz[v] - (v < n));
sz[v] += (v < n);
if(idpar != -1)
good[v][idpar] = allgood[v] - sz[v];
//cout << "oh oh " << v << ' ' << allgood[v] << ' ' << sz[v] << endl;
}
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
int m; cin >> n >> m;
for(int i = 0; i < m; i++){
int a, b; cin >> a >> b;
a--; b--;
adj[a].pb(b);
adj[b].pb(a);
}
newid = n;
for(int i = 0; i < n; i++) if(!mark[i]){
num = 0;
dfs1(i);
dfs2(i);
}
memset(mark, false, sizeof mark);
for(int i = 0; i < newid; i++) if(!mark[i])
dfs3(i);
for(int i = 0; i < n; i++){
ans += have[i];
//cout << "aha " << i << ' ' << have[i] << endl;
for(int j = 0; j < bladj[i].size(); j++){
int u = bladj[i][j];
//cout << "ok " << j << ' ' << u << ' ' << good[i][j] << ' ' << have[u] << endl;
ans += have[u] - good[i][j] * (allgood[i] - good[i][j]);
//cout << "hey! " << ans << endl;
}
}
cout << ans * 2 << endl;
}
Compilation message
count_triplets.cpp: In function 'void dfs3(int)':
count_triplets.cpp:70:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
70 | for(int i = 0; i < bladj[v].size(); i++){
| ~~^~~~~~~~~~~~~~~~~
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:113:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
113 | for(int j = 0; j < bladj[i].size(); j++){
| ~~^~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
47816 KB |
Output is correct |
2 |
Correct |
22 ms |
47720 KB |
Output is correct |
3 |
Correct |
23 ms |
47808 KB |
Output is correct |
4 |
Correct |
23 ms |
47732 KB |
Output is correct |
5 |
Correct |
23 ms |
47728 KB |
Output is correct |
6 |
Correct |
22 ms |
47700 KB |
Output is correct |
7 |
Correct |
22 ms |
47788 KB |
Output is correct |
8 |
Correct |
22 ms |
47828 KB |
Output is correct |
9 |
Correct |
23 ms |
47712 KB |
Output is correct |
10 |
Correct |
22 ms |
47812 KB |
Output is correct |
11 |
Correct |
23 ms |
47820 KB |
Output is correct |
12 |
Correct |
22 ms |
47772 KB |
Output is correct |
13 |
Correct |
23 ms |
47700 KB |
Output is correct |
14 |
Correct |
23 ms |
47752 KB |
Output is correct |
15 |
Correct |
22 ms |
47816 KB |
Output is correct |
16 |
Correct |
22 ms |
47700 KB |
Output is correct |
17 |
Correct |
22 ms |
47700 KB |
Output is correct |
18 |
Correct |
23 ms |
47816 KB |
Output is correct |
19 |
Correct |
24 ms |
47816 KB |
Output is correct |
20 |
Correct |
22 ms |
47692 KB |
Output is correct |
21 |
Correct |
25 ms |
47828 KB |
Output is correct |
22 |
Correct |
22 ms |
47812 KB |
Output is correct |
23 |
Correct |
23 ms |
47804 KB |
Output is correct |
24 |
Correct |
23 ms |
47768 KB |
Output is correct |
25 |
Correct |
22 ms |
47700 KB |
Output is correct |
26 |
Correct |
22 ms |
47772 KB |
Output is correct |
27 |
Correct |
22 ms |
47756 KB |
Output is correct |
28 |
Correct |
23 ms |
47720 KB |
Output is correct |
29 |
Correct |
22 ms |
47692 KB |
Output is correct |
30 |
Correct |
23 ms |
47692 KB |
Output is correct |
31 |
Correct |
22 ms |
47700 KB |
Output is correct |
32 |
Correct |
23 ms |
47772 KB |
Output is correct |
33 |
Correct |
22 ms |
47728 KB |
Output is correct |
34 |
Correct |
26 ms |
47900 KB |
Output is correct |
35 |
Correct |
23 ms |
47828 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
47816 KB |
Output is correct |
2 |
Correct |
22 ms |
47720 KB |
Output is correct |
3 |
Correct |
23 ms |
47808 KB |
Output is correct |
4 |
Correct |
23 ms |
47732 KB |
Output is correct |
5 |
Correct |
23 ms |
47728 KB |
Output is correct |
6 |
Correct |
22 ms |
47700 KB |
Output is correct |
7 |
Correct |
22 ms |
47788 KB |
Output is correct |
8 |
Correct |
22 ms |
47828 KB |
Output is correct |
9 |
Correct |
23 ms |
47712 KB |
Output is correct |
10 |
Correct |
22 ms |
47812 KB |
Output is correct |
11 |
Correct |
23 ms |
47820 KB |
Output is correct |
12 |
Correct |
22 ms |
47772 KB |
Output is correct |
13 |
Correct |
23 ms |
47700 KB |
Output is correct |
14 |
Correct |
23 ms |
47752 KB |
Output is correct |
15 |
Correct |
22 ms |
47816 KB |
Output is correct |
16 |
Correct |
22 ms |
47700 KB |
Output is correct |
17 |
Correct |
22 ms |
47700 KB |
Output is correct |
18 |
Correct |
23 ms |
47816 KB |
Output is correct |
19 |
Correct |
24 ms |
47816 KB |
Output is correct |
20 |
Correct |
22 ms |
47692 KB |
Output is correct |
21 |
Correct |
25 ms |
47828 KB |
Output is correct |
22 |
Correct |
22 ms |
47812 KB |
Output is correct |
23 |
Correct |
23 ms |
47804 KB |
Output is correct |
24 |
Correct |
23 ms |
47768 KB |
Output is correct |
25 |
Correct |
22 ms |
47700 KB |
Output is correct |
26 |
Correct |
22 ms |
47772 KB |
Output is correct |
27 |
Correct |
22 ms |
47756 KB |
Output is correct |
28 |
Correct |
23 ms |
47720 KB |
Output is correct |
29 |
Correct |
22 ms |
47692 KB |
Output is correct |
30 |
Correct |
23 ms |
47692 KB |
Output is correct |
31 |
Correct |
22 ms |
47700 KB |
Output is correct |
32 |
Correct |
23 ms |
47772 KB |
Output is correct |
33 |
Correct |
22 ms |
47728 KB |
Output is correct |
34 |
Correct |
26 ms |
47900 KB |
Output is correct |
35 |
Correct |
23 ms |
47828 KB |
Output is correct |
36 |
Correct |
22 ms |
47700 KB |
Output is correct |
37 |
Correct |
22 ms |
47812 KB |
Output is correct |
38 |
Correct |
25 ms |
47736 KB |
Output is correct |
39 |
Correct |
24 ms |
47776 KB |
Output is correct |
40 |
Correct |
23 ms |
47840 KB |
Output is correct |
41 |
Correct |
23 ms |
47816 KB |
Output is correct |
42 |
Correct |
23 ms |
47812 KB |
Output is correct |
43 |
Correct |
25 ms |
47776 KB |
Output is correct |
44 |
Correct |
23 ms |
47824 KB |
Output is correct |
45 |
Correct |
22 ms |
47736 KB |
Output is correct |
46 |
Correct |
22 ms |
47828 KB |
Output is correct |
47 |
Correct |
24 ms |
47788 KB |
Output is correct |
48 |
Correct |
23 ms |
47728 KB |
Output is correct |
49 |
Correct |
23 ms |
47772 KB |
Output is correct |
50 |
Correct |
22 ms |
47812 KB |
Output is correct |
51 |
Correct |
23 ms |
47824 KB |
Output is correct |
52 |
Correct |
22 ms |
47828 KB |
Output is correct |
53 |
Correct |
22 ms |
47808 KB |
Output is correct |
54 |
Correct |
22 ms |
47728 KB |
Output is correct |
55 |
Correct |
22 ms |
47808 KB |
Output is correct |
56 |
Correct |
22 ms |
47828 KB |
Output is correct |
57 |
Correct |
22 ms |
47716 KB |
Output is correct |
58 |
Correct |
22 ms |
47828 KB |
Output is correct |
59 |
Correct |
22 ms |
47812 KB |
Output is correct |
60 |
Correct |
22 ms |
47828 KB |
Output is correct |
61 |
Correct |
22 ms |
47828 KB |
Output is correct |
62 |
Correct |
22 ms |
47828 KB |
Output is correct |
63 |
Correct |
23 ms |
47812 KB |
Output is correct |
64 |
Correct |
23 ms |
47716 KB |
Output is correct |
65 |
Correct |
23 ms |
47716 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
118 ms |
75208 KB |
Output is correct |
2 |
Correct |
125 ms |
75168 KB |
Output is correct |
3 |
Correct |
139 ms |
77340 KB |
Output is correct |
4 |
Correct |
125 ms |
74700 KB |
Output is correct |
5 |
Correct |
126 ms |
73312 KB |
Output is correct |
6 |
Correct |
135 ms |
76216 KB |
Output is correct |
7 |
Correct |
146 ms |
74064 KB |
Output is correct |
8 |
Correct |
138 ms |
74440 KB |
Output is correct |
9 |
Correct |
137 ms |
72192 KB |
Output is correct |
10 |
Correct |
139 ms |
72228 KB |
Output is correct |
11 |
Correct |
113 ms |
67836 KB |
Output is correct |
12 |
Correct |
123 ms |
67508 KB |
Output is correct |
13 |
Correct |
104 ms |
66972 KB |
Output is correct |
14 |
Correct |
102 ms |
66488 KB |
Output is correct |
15 |
Correct |
83 ms |
64300 KB |
Output is correct |
16 |
Correct |
96 ms |
64120 KB |
Output is correct |
17 |
Correct |
27 ms |
50892 KB |
Output is correct |
18 |
Correct |
27 ms |
50860 KB |
Output is correct |
19 |
Correct |
27 ms |
50800 KB |
Output is correct |
20 |
Correct |
27 ms |
50748 KB |
Output is correct |
21 |
Correct |
27 ms |
50764 KB |
Output is correct |
22 |
Correct |
26 ms |
50792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
47932 KB |
Output is correct |
2 |
Correct |
27 ms |
48056 KB |
Output is correct |
3 |
Correct |
24 ms |
48004 KB |
Output is correct |
4 |
Correct |
24 ms |
48152 KB |
Output is correct |
5 |
Correct |
23 ms |
48160 KB |
Output is correct |
6 |
Correct |
23 ms |
48084 KB |
Output is correct |
7 |
Correct |
24 ms |
48132 KB |
Output is correct |
8 |
Correct |
23 ms |
48008 KB |
Output is correct |
9 |
Correct |
22 ms |
48020 KB |
Output is correct |
10 |
Correct |
24 ms |
47956 KB |
Output is correct |
11 |
Correct |
24 ms |
47944 KB |
Output is correct |
12 |
Correct |
23 ms |
47956 KB |
Output is correct |
13 |
Correct |
24 ms |
47956 KB |
Output is correct |
14 |
Correct |
23 ms |
48052 KB |
Output is correct |
15 |
Correct |
24 ms |
47948 KB |
Output is correct |
16 |
Correct |
25 ms |
47956 KB |
Output is correct |
17 |
Correct |
23 ms |
47956 KB |
Output is correct |
18 |
Correct |
24 ms |
47948 KB |
Output is correct |
19 |
Correct |
24 ms |
47948 KB |
Output is correct |
20 |
Correct |
24 ms |
48052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
159 ms |
72344 KB |
Output is correct |
2 |
Correct |
144 ms |
72264 KB |
Output is correct |
3 |
Correct |
147 ms |
72208 KB |
Output is correct |
4 |
Correct |
152 ms |
72272 KB |
Output is correct |
5 |
Correct |
154 ms |
72236 KB |
Output is correct |
6 |
Correct |
147 ms |
83528 KB |
Output is correct |
7 |
Correct |
156 ms |
79348 KB |
Output is correct |
8 |
Correct |
156 ms |
77472 KB |
Output is correct |
9 |
Correct |
152 ms |
75732 KB |
Output is correct |
10 |
Correct |
135 ms |
72232 KB |
Output is correct |
11 |
Correct |
136 ms |
72264 KB |
Output is correct |
12 |
Correct |
149 ms |
72176 KB |
Output is correct |
13 |
Correct |
146 ms |
72248 KB |
Output is correct |
14 |
Correct |
140 ms |
70988 KB |
Output is correct |
15 |
Correct |
121 ms |
69580 KB |
Output is correct |
16 |
Correct |
86 ms |
64128 KB |
Output is correct |
17 |
Correct |
125 ms |
72236 KB |
Output is correct |
18 |
Correct |
113 ms |
72176 KB |
Output is correct |
19 |
Correct |
125 ms |
72128 KB |
Output is correct |
20 |
Correct |
139 ms |
72200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
47944 KB |
Output is correct |
2 |
Correct |
29 ms |
48036 KB |
Output is correct |
3 |
Correct |
24 ms |
47948 KB |
Output is correct |
4 |
Correct |
24 ms |
47956 KB |
Output is correct |
5 |
Correct |
23 ms |
48012 KB |
Output is correct |
6 |
Correct |
23 ms |
47932 KB |
Output is correct |
7 |
Correct |
23 ms |
47940 KB |
Output is correct |
8 |
Correct |
23 ms |
47956 KB |
Output is correct |
9 |
Correct |
23 ms |
47956 KB |
Output is correct |
10 |
Correct |
23 ms |
47956 KB |
Output is correct |
11 |
Correct |
24 ms |
47968 KB |
Output is correct |
12 |
Correct |
24 ms |
48004 KB |
Output is correct |
13 |
Correct |
24 ms |
47968 KB |
Output is correct |
14 |
Correct |
24 ms |
48084 KB |
Output is correct |
15 |
Correct |
24 ms |
48004 KB |
Output is correct |
16 |
Correct |
24 ms |
47976 KB |
Output is correct |
17 |
Correct |
26 ms |
48008 KB |
Output is correct |
18 |
Correct |
23 ms |
47956 KB |
Output is correct |
19 |
Correct |
23 ms |
47952 KB |
Output is correct |
20 |
Correct |
25 ms |
47908 KB |
Output is correct |
21 |
Correct |
24 ms |
48016 KB |
Output is correct |
22 |
Correct |
23 ms |
47956 KB |
Output is correct |
23 |
Correct |
23 ms |
48020 KB |
Output is correct |
24 |
Correct |
23 ms |
47984 KB |
Output is correct |
25 |
Correct |
22 ms |
47908 KB |
Output is correct |
26 |
Correct |
22 ms |
47828 KB |
Output is correct |
27 |
Correct |
24 ms |
47812 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
140 ms |
72256 KB |
Output is correct |
2 |
Correct |
136 ms |
72396 KB |
Output is correct |
3 |
Correct |
150 ms |
71308 KB |
Output is correct |
4 |
Correct |
132 ms |
69720 KB |
Output is correct |
5 |
Correct |
129 ms |
68140 KB |
Output is correct |
6 |
Correct |
122 ms |
67524 KB |
Output is correct |
7 |
Correct |
122 ms |
67160 KB |
Output is correct |
8 |
Correct |
126 ms |
66768 KB |
Output is correct |
9 |
Correct |
127 ms |
66796 KB |
Output is correct |
10 |
Correct |
120 ms |
66500 KB |
Output is correct |
11 |
Correct |
113 ms |
66380 KB |
Output is correct |
12 |
Correct |
115 ms |
66292 KB |
Output is correct |
13 |
Correct |
119 ms |
66384 KB |
Output is correct |
14 |
Correct |
124 ms |
68396 KB |
Output is correct |
15 |
Correct |
154 ms |
78560 KB |
Output is correct |
16 |
Correct |
163 ms |
75956 KB |
Output is correct |
17 |
Correct |
164 ms |
76688 KB |
Output is correct |
18 |
Correct |
154 ms |
74360 KB |
Output is correct |
19 |
Correct |
133 ms |
69772 KB |
Output is correct |
20 |
Correct |
136 ms |
69712 KB |
Output is correct |
21 |
Correct |
154 ms |
69868 KB |
Output is correct |
22 |
Correct |
127 ms |
68508 KB |
Output is correct |
23 |
Correct |
120 ms |
67328 KB |
Output is correct |
24 |
Correct |
132 ms |
71448 KB |
Output is correct |
25 |
Correct |
138 ms |
71624 KB |
Output is correct |
26 |
Correct |
131 ms |
70660 KB |
Output is correct |
27 |
Correct |
139 ms |
70672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
47816 KB |
Output is correct |
2 |
Correct |
22 ms |
47720 KB |
Output is correct |
3 |
Correct |
23 ms |
47808 KB |
Output is correct |
4 |
Correct |
23 ms |
47732 KB |
Output is correct |
5 |
Correct |
23 ms |
47728 KB |
Output is correct |
6 |
Correct |
22 ms |
47700 KB |
Output is correct |
7 |
Correct |
22 ms |
47788 KB |
Output is correct |
8 |
Correct |
22 ms |
47828 KB |
Output is correct |
9 |
Correct |
23 ms |
47712 KB |
Output is correct |
10 |
Correct |
22 ms |
47812 KB |
Output is correct |
11 |
Correct |
23 ms |
47820 KB |
Output is correct |
12 |
Correct |
22 ms |
47772 KB |
Output is correct |
13 |
Correct |
23 ms |
47700 KB |
Output is correct |
14 |
Correct |
23 ms |
47752 KB |
Output is correct |
15 |
Correct |
22 ms |
47816 KB |
Output is correct |
16 |
Correct |
22 ms |
47700 KB |
Output is correct |
17 |
Correct |
22 ms |
47700 KB |
Output is correct |
18 |
Correct |
23 ms |
47816 KB |
Output is correct |
19 |
Correct |
24 ms |
47816 KB |
Output is correct |
20 |
Correct |
22 ms |
47692 KB |
Output is correct |
21 |
Correct |
25 ms |
47828 KB |
Output is correct |
22 |
Correct |
22 ms |
47812 KB |
Output is correct |
23 |
Correct |
23 ms |
47804 KB |
Output is correct |
24 |
Correct |
23 ms |
47768 KB |
Output is correct |
25 |
Correct |
22 ms |
47700 KB |
Output is correct |
26 |
Correct |
22 ms |
47772 KB |
Output is correct |
27 |
Correct |
22 ms |
47756 KB |
Output is correct |
28 |
Correct |
23 ms |
47720 KB |
Output is correct |
29 |
Correct |
22 ms |
47692 KB |
Output is correct |
30 |
Correct |
23 ms |
47692 KB |
Output is correct |
31 |
Correct |
22 ms |
47700 KB |
Output is correct |
32 |
Correct |
23 ms |
47772 KB |
Output is correct |
33 |
Correct |
22 ms |
47728 KB |
Output is correct |
34 |
Correct |
26 ms |
47900 KB |
Output is correct |
35 |
Correct |
23 ms |
47828 KB |
Output is correct |
36 |
Correct |
22 ms |
47700 KB |
Output is correct |
37 |
Correct |
22 ms |
47812 KB |
Output is correct |
38 |
Correct |
25 ms |
47736 KB |
Output is correct |
39 |
Correct |
24 ms |
47776 KB |
Output is correct |
40 |
Correct |
23 ms |
47840 KB |
Output is correct |
41 |
Correct |
23 ms |
47816 KB |
Output is correct |
42 |
Correct |
23 ms |
47812 KB |
Output is correct |
43 |
Correct |
25 ms |
47776 KB |
Output is correct |
44 |
Correct |
23 ms |
47824 KB |
Output is correct |
45 |
Correct |
22 ms |
47736 KB |
Output is correct |
46 |
Correct |
22 ms |
47828 KB |
Output is correct |
47 |
Correct |
24 ms |
47788 KB |
Output is correct |
48 |
Correct |
23 ms |
47728 KB |
Output is correct |
49 |
Correct |
23 ms |
47772 KB |
Output is correct |
50 |
Correct |
22 ms |
47812 KB |
Output is correct |
51 |
Correct |
23 ms |
47824 KB |
Output is correct |
52 |
Correct |
22 ms |
47828 KB |
Output is correct |
53 |
Correct |
22 ms |
47808 KB |
Output is correct |
54 |
Correct |
22 ms |
47728 KB |
Output is correct |
55 |
Correct |
22 ms |
47808 KB |
Output is correct |
56 |
Correct |
22 ms |
47828 KB |
Output is correct |
57 |
Correct |
22 ms |
47716 KB |
Output is correct |
58 |
Correct |
22 ms |
47828 KB |
Output is correct |
59 |
Correct |
22 ms |
47812 KB |
Output is correct |
60 |
Correct |
22 ms |
47828 KB |
Output is correct |
61 |
Correct |
22 ms |
47828 KB |
Output is correct |
62 |
Correct |
22 ms |
47828 KB |
Output is correct |
63 |
Correct |
23 ms |
47812 KB |
Output is correct |
64 |
Correct |
23 ms |
47716 KB |
Output is correct |
65 |
Correct |
23 ms |
47716 KB |
Output is correct |
66 |
Correct |
23 ms |
47828 KB |
Output is correct |
67 |
Correct |
24 ms |
47960 KB |
Output is correct |
68 |
Correct |
25 ms |
47904 KB |
Output is correct |
69 |
Correct |
24 ms |
48028 KB |
Output is correct |
70 |
Correct |
25 ms |
47988 KB |
Output is correct |
71 |
Correct |
24 ms |
47956 KB |
Output is correct |
72 |
Correct |
26 ms |
48084 KB |
Output is correct |
73 |
Correct |
25 ms |
47948 KB |
Output is correct |
74 |
Correct |
23 ms |
47996 KB |
Output is correct |
75 |
Correct |
22 ms |
47904 KB |
Output is correct |
76 |
Correct |
23 ms |
47744 KB |
Output is correct |
77 |
Correct |
26 ms |
47908 KB |
Output is correct |
78 |
Correct |
23 ms |
47952 KB |
Output is correct |
79 |
Correct |
23 ms |
47896 KB |
Output is correct |
80 |
Correct |
23 ms |
47956 KB |
Output is correct |
81 |
Correct |
23 ms |
47968 KB |
Output is correct |
82 |
Correct |
23 ms |
47956 KB |
Output is correct |
83 |
Correct |
24 ms |
48016 KB |
Output is correct |
84 |
Correct |
26 ms |
47956 KB |
Output is correct |
85 |
Correct |
23 ms |
47948 KB |
Output is correct |
86 |
Correct |
22 ms |
47952 KB |
Output is correct |
87 |
Correct |
22 ms |
47940 KB |
Output is correct |
88 |
Correct |
24 ms |
47936 KB |
Output is correct |
89 |
Correct |
23 ms |
47944 KB |
Output is correct |
90 |
Correct |
23 ms |
47952 KB |
Output is correct |
91 |
Correct |
24 ms |
47960 KB |
Output is correct |
92 |
Correct |
23 ms |
48036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
47816 KB |
Output is correct |
2 |
Correct |
22 ms |
47720 KB |
Output is correct |
3 |
Correct |
23 ms |
47808 KB |
Output is correct |
4 |
Correct |
23 ms |
47732 KB |
Output is correct |
5 |
Correct |
23 ms |
47728 KB |
Output is correct |
6 |
Correct |
22 ms |
47700 KB |
Output is correct |
7 |
Correct |
22 ms |
47788 KB |
Output is correct |
8 |
Correct |
22 ms |
47828 KB |
Output is correct |
9 |
Correct |
23 ms |
47712 KB |
Output is correct |
10 |
Correct |
22 ms |
47812 KB |
Output is correct |
11 |
Correct |
23 ms |
47820 KB |
Output is correct |
12 |
Correct |
22 ms |
47772 KB |
Output is correct |
13 |
Correct |
23 ms |
47700 KB |
Output is correct |
14 |
Correct |
23 ms |
47752 KB |
Output is correct |
15 |
Correct |
22 ms |
47816 KB |
Output is correct |
16 |
Correct |
22 ms |
47700 KB |
Output is correct |
17 |
Correct |
22 ms |
47700 KB |
Output is correct |
18 |
Correct |
23 ms |
47816 KB |
Output is correct |
19 |
Correct |
24 ms |
47816 KB |
Output is correct |
20 |
Correct |
22 ms |
47692 KB |
Output is correct |
21 |
Correct |
25 ms |
47828 KB |
Output is correct |
22 |
Correct |
22 ms |
47812 KB |
Output is correct |
23 |
Correct |
23 ms |
47804 KB |
Output is correct |
24 |
Correct |
23 ms |
47768 KB |
Output is correct |
25 |
Correct |
22 ms |
47700 KB |
Output is correct |
26 |
Correct |
22 ms |
47772 KB |
Output is correct |
27 |
Correct |
22 ms |
47756 KB |
Output is correct |
28 |
Correct |
23 ms |
47720 KB |
Output is correct |
29 |
Correct |
22 ms |
47692 KB |
Output is correct |
30 |
Correct |
23 ms |
47692 KB |
Output is correct |
31 |
Correct |
22 ms |
47700 KB |
Output is correct |
32 |
Correct |
23 ms |
47772 KB |
Output is correct |
33 |
Correct |
22 ms |
47728 KB |
Output is correct |
34 |
Correct |
26 ms |
47900 KB |
Output is correct |
35 |
Correct |
23 ms |
47828 KB |
Output is correct |
36 |
Correct |
22 ms |
47700 KB |
Output is correct |
37 |
Correct |
22 ms |
47812 KB |
Output is correct |
38 |
Correct |
25 ms |
47736 KB |
Output is correct |
39 |
Correct |
24 ms |
47776 KB |
Output is correct |
40 |
Correct |
23 ms |
47840 KB |
Output is correct |
41 |
Correct |
23 ms |
47816 KB |
Output is correct |
42 |
Correct |
23 ms |
47812 KB |
Output is correct |
43 |
Correct |
25 ms |
47776 KB |
Output is correct |
44 |
Correct |
23 ms |
47824 KB |
Output is correct |
45 |
Correct |
22 ms |
47736 KB |
Output is correct |
46 |
Correct |
22 ms |
47828 KB |
Output is correct |
47 |
Correct |
24 ms |
47788 KB |
Output is correct |
48 |
Correct |
23 ms |
47728 KB |
Output is correct |
49 |
Correct |
23 ms |
47772 KB |
Output is correct |
50 |
Correct |
22 ms |
47812 KB |
Output is correct |
51 |
Correct |
23 ms |
47824 KB |
Output is correct |
52 |
Correct |
22 ms |
47828 KB |
Output is correct |
53 |
Correct |
22 ms |
47808 KB |
Output is correct |
54 |
Correct |
22 ms |
47728 KB |
Output is correct |
55 |
Correct |
22 ms |
47808 KB |
Output is correct |
56 |
Correct |
22 ms |
47828 KB |
Output is correct |
57 |
Correct |
22 ms |
47716 KB |
Output is correct |
58 |
Correct |
22 ms |
47828 KB |
Output is correct |
59 |
Correct |
22 ms |
47812 KB |
Output is correct |
60 |
Correct |
22 ms |
47828 KB |
Output is correct |
61 |
Correct |
22 ms |
47828 KB |
Output is correct |
62 |
Correct |
22 ms |
47828 KB |
Output is correct |
63 |
Correct |
23 ms |
47812 KB |
Output is correct |
64 |
Correct |
23 ms |
47716 KB |
Output is correct |
65 |
Correct |
23 ms |
47716 KB |
Output is correct |
66 |
Correct |
118 ms |
75208 KB |
Output is correct |
67 |
Correct |
125 ms |
75168 KB |
Output is correct |
68 |
Correct |
139 ms |
77340 KB |
Output is correct |
69 |
Correct |
125 ms |
74700 KB |
Output is correct |
70 |
Correct |
126 ms |
73312 KB |
Output is correct |
71 |
Correct |
135 ms |
76216 KB |
Output is correct |
72 |
Correct |
146 ms |
74064 KB |
Output is correct |
73 |
Correct |
138 ms |
74440 KB |
Output is correct |
74 |
Correct |
137 ms |
72192 KB |
Output is correct |
75 |
Correct |
139 ms |
72228 KB |
Output is correct |
76 |
Correct |
113 ms |
67836 KB |
Output is correct |
77 |
Correct |
123 ms |
67508 KB |
Output is correct |
78 |
Correct |
104 ms |
66972 KB |
Output is correct |
79 |
Correct |
102 ms |
66488 KB |
Output is correct |
80 |
Correct |
83 ms |
64300 KB |
Output is correct |
81 |
Correct |
96 ms |
64120 KB |
Output is correct |
82 |
Correct |
27 ms |
50892 KB |
Output is correct |
83 |
Correct |
27 ms |
50860 KB |
Output is correct |
84 |
Correct |
27 ms |
50800 KB |
Output is correct |
85 |
Correct |
27 ms |
50748 KB |
Output is correct |
86 |
Correct |
27 ms |
50764 KB |
Output is correct |
87 |
Correct |
26 ms |
50792 KB |
Output is correct |
88 |
Correct |
25 ms |
47932 KB |
Output is correct |
89 |
Correct |
27 ms |
48056 KB |
Output is correct |
90 |
Correct |
24 ms |
48004 KB |
Output is correct |
91 |
Correct |
24 ms |
48152 KB |
Output is correct |
92 |
Correct |
23 ms |
48160 KB |
Output is correct |
93 |
Correct |
23 ms |
48084 KB |
Output is correct |
94 |
Correct |
24 ms |
48132 KB |
Output is correct |
95 |
Correct |
23 ms |
48008 KB |
Output is correct |
96 |
Correct |
22 ms |
48020 KB |
Output is correct |
97 |
Correct |
24 ms |
47956 KB |
Output is correct |
98 |
Correct |
24 ms |
47944 KB |
Output is correct |
99 |
Correct |
23 ms |
47956 KB |
Output is correct |
100 |
Correct |
24 ms |
47956 KB |
Output is correct |
101 |
Correct |
23 ms |
48052 KB |
Output is correct |
102 |
Correct |
24 ms |
47948 KB |
Output is correct |
103 |
Correct |
25 ms |
47956 KB |
Output is correct |
104 |
Correct |
23 ms |
47956 KB |
Output is correct |
105 |
Correct |
24 ms |
47948 KB |
Output is correct |
106 |
Correct |
24 ms |
47948 KB |
Output is correct |
107 |
Correct |
24 ms |
48052 KB |
Output is correct |
108 |
Correct |
159 ms |
72344 KB |
Output is correct |
109 |
Correct |
144 ms |
72264 KB |
Output is correct |
110 |
Correct |
147 ms |
72208 KB |
Output is correct |
111 |
Correct |
152 ms |
72272 KB |
Output is correct |
112 |
Correct |
154 ms |
72236 KB |
Output is correct |
113 |
Correct |
147 ms |
83528 KB |
Output is correct |
114 |
Correct |
156 ms |
79348 KB |
Output is correct |
115 |
Correct |
156 ms |
77472 KB |
Output is correct |
116 |
Correct |
152 ms |
75732 KB |
Output is correct |
117 |
Correct |
135 ms |
72232 KB |
Output is correct |
118 |
Correct |
136 ms |
72264 KB |
Output is correct |
119 |
Correct |
149 ms |
72176 KB |
Output is correct |
120 |
Correct |
146 ms |
72248 KB |
Output is correct |
121 |
Correct |
140 ms |
70988 KB |
Output is correct |
122 |
Correct |
121 ms |
69580 KB |
Output is correct |
123 |
Correct |
86 ms |
64128 KB |
Output is correct |
124 |
Correct |
125 ms |
72236 KB |
Output is correct |
125 |
Correct |
113 ms |
72176 KB |
Output is correct |
126 |
Correct |
125 ms |
72128 KB |
Output is correct |
127 |
Correct |
139 ms |
72200 KB |
Output is correct |
128 |
Correct |
25 ms |
47944 KB |
Output is correct |
129 |
Correct |
29 ms |
48036 KB |
Output is correct |
130 |
Correct |
24 ms |
47948 KB |
Output is correct |
131 |
Correct |
24 ms |
47956 KB |
Output is correct |
132 |
Correct |
23 ms |
48012 KB |
Output is correct |
133 |
Correct |
23 ms |
47932 KB |
Output is correct |
134 |
Correct |
23 ms |
47940 KB |
Output is correct |
135 |
Correct |
23 ms |
47956 KB |
Output is correct |
136 |
Correct |
23 ms |
47956 KB |
Output is correct |
137 |
Correct |
23 ms |
47956 KB |
Output is correct |
138 |
Correct |
24 ms |
47968 KB |
Output is correct |
139 |
Correct |
24 ms |
48004 KB |
Output is correct |
140 |
Correct |
24 ms |
47968 KB |
Output is correct |
141 |
Correct |
24 ms |
48084 KB |
Output is correct |
142 |
Correct |
24 ms |
48004 KB |
Output is correct |
143 |
Correct |
24 ms |
47976 KB |
Output is correct |
144 |
Correct |
26 ms |
48008 KB |
Output is correct |
145 |
Correct |
23 ms |
47956 KB |
Output is correct |
146 |
Correct |
23 ms |
47952 KB |
Output is correct |
147 |
Correct |
25 ms |
47908 KB |
Output is correct |
148 |
Correct |
24 ms |
48016 KB |
Output is correct |
149 |
Correct |
23 ms |
47956 KB |
Output is correct |
150 |
Correct |
23 ms |
48020 KB |
Output is correct |
151 |
Correct |
23 ms |
47984 KB |
Output is correct |
152 |
Correct |
22 ms |
47908 KB |
Output is correct |
153 |
Correct |
22 ms |
47828 KB |
Output is correct |
154 |
Correct |
24 ms |
47812 KB |
Output is correct |
155 |
Correct |
140 ms |
72256 KB |
Output is correct |
156 |
Correct |
136 ms |
72396 KB |
Output is correct |
157 |
Correct |
150 ms |
71308 KB |
Output is correct |
158 |
Correct |
132 ms |
69720 KB |
Output is correct |
159 |
Correct |
129 ms |
68140 KB |
Output is correct |
160 |
Correct |
122 ms |
67524 KB |
Output is correct |
161 |
Correct |
122 ms |
67160 KB |
Output is correct |
162 |
Correct |
126 ms |
66768 KB |
Output is correct |
163 |
Correct |
127 ms |
66796 KB |
Output is correct |
164 |
Correct |
120 ms |
66500 KB |
Output is correct |
165 |
Correct |
113 ms |
66380 KB |
Output is correct |
166 |
Correct |
115 ms |
66292 KB |
Output is correct |
167 |
Correct |
119 ms |
66384 KB |
Output is correct |
168 |
Correct |
124 ms |
68396 KB |
Output is correct |
169 |
Correct |
154 ms |
78560 KB |
Output is correct |
170 |
Correct |
163 ms |
75956 KB |
Output is correct |
171 |
Correct |
164 ms |
76688 KB |
Output is correct |
172 |
Correct |
154 ms |
74360 KB |
Output is correct |
173 |
Correct |
133 ms |
69772 KB |
Output is correct |
174 |
Correct |
136 ms |
69712 KB |
Output is correct |
175 |
Correct |
154 ms |
69868 KB |
Output is correct |
176 |
Correct |
127 ms |
68508 KB |
Output is correct |
177 |
Correct |
120 ms |
67328 KB |
Output is correct |
178 |
Correct |
132 ms |
71448 KB |
Output is correct |
179 |
Correct |
138 ms |
71624 KB |
Output is correct |
180 |
Correct |
131 ms |
70660 KB |
Output is correct |
181 |
Correct |
139 ms |
70672 KB |
Output is correct |
182 |
Correct |
23 ms |
47828 KB |
Output is correct |
183 |
Correct |
24 ms |
47960 KB |
Output is correct |
184 |
Correct |
25 ms |
47904 KB |
Output is correct |
185 |
Correct |
24 ms |
48028 KB |
Output is correct |
186 |
Correct |
25 ms |
47988 KB |
Output is correct |
187 |
Correct |
24 ms |
47956 KB |
Output is correct |
188 |
Correct |
26 ms |
48084 KB |
Output is correct |
189 |
Correct |
25 ms |
47948 KB |
Output is correct |
190 |
Correct |
23 ms |
47996 KB |
Output is correct |
191 |
Correct |
22 ms |
47904 KB |
Output is correct |
192 |
Correct |
23 ms |
47744 KB |
Output is correct |
193 |
Correct |
26 ms |
47908 KB |
Output is correct |
194 |
Correct |
23 ms |
47952 KB |
Output is correct |
195 |
Correct |
23 ms |
47896 KB |
Output is correct |
196 |
Correct |
23 ms |
47956 KB |
Output is correct |
197 |
Correct |
23 ms |
47968 KB |
Output is correct |
198 |
Correct |
23 ms |
47956 KB |
Output is correct |
199 |
Correct |
24 ms |
48016 KB |
Output is correct |
200 |
Correct |
26 ms |
47956 KB |
Output is correct |
201 |
Correct |
23 ms |
47948 KB |
Output is correct |
202 |
Correct |
22 ms |
47952 KB |
Output is correct |
203 |
Correct |
22 ms |
47940 KB |
Output is correct |
204 |
Correct |
24 ms |
47936 KB |
Output is correct |
205 |
Correct |
23 ms |
47944 KB |
Output is correct |
206 |
Correct |
23 ms |
47952 KB |
Output is correct |
207 |
Correct |
24 ms |
47960 KB |
Output is correct |
208 |
Correct |
23 ms |
48036 KB |
Output is correct |
209 |
Correct |
23 ms |
50516 KB |
Output is correct |
210 |
Correct |
93 ms |
63036 KB |
Output is correct |
211 |
Correct |
123 ms |
68296 KB |
Output is correct |
212 |
Correct |
140 ms |
71012 KB |
Output is correct |
213 |
Correct |
165 ms |
72972 KB |
Output is correct |
214 |
Correct |
78 ms |
67052 KB |
Output is correct |
215 |
Correct |
80 ms |
66676 KB |
Output is correct |
216 |
Correct |
132 ms |
70140 KB |
Output is correct |
217 |
Correct |
133 ms |
68364 KB |
Output is correct |
218 |
Correct |
122 ms |
66668 KB |
Output is correct |
219 |
Correct |
121 ms |
66276 KB |
Output is correct |
220 |
Correct |
113 ms |
66252 KB |
Output is correct |
221 |
Correct |
111 ms |
66256 KB |
Output is correct |
222 |
Correct |
125 ms |
67584 KB |
Output is correct |
223 |
Correct |
159 ms |
71068 KB |
Output is correct |
224 |
Correct |
152 ms |
70220 KB |
Output is correct |
225 |
Correct |
138 ms |
67924 KB |
Output is correct |
226 |
Correct |
147 ms |
67996 KB |
Output is correct |
227 |
Correct |
132 ms |
67928 KB |
Output is correct |
228 |
Correct |
129 ms |
67280 KB |
Output is correct |
229 |
Correct |
140 ms |
66644 KB |
Output is correct |
230 |
Correct |
150 ms |
68788 KB |
Output is correct |
231 |
Correct |
133 ms |
68684 KB |
Output is correct |