#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll c2(ll x) { return x*(x-1)/2; }
inline ll c3(ll x) { return x*(x-1)*(x-2)/6; }
int n, m;
vector<int> link[100002];
ll ans;
void input();
void makeBCC();
void vertexCount();
void lastDFS();
int main(){
input();
makeBCC();
vertexCount();
lastDFS();
printf("%lld", ans);
}
void input(){
scanf("%d %d", &n, &m);
for(int i=1; i<=m; i++){
int x, y;
scanf("%d %d", &x, &y);
link[x].push_back(y);
link[y].push_back(x);
}
}
ll seenCnt;
int dfsn[100002];
int dcnt;
stack<pair<int, int> > stk;
vector<vector<pair<int, int> > > BCC;
vector<int> bccIdx[100002];
vector<int> tlink[200002];
int k;
stack<int> thisComponent;
ll con[200002];
ll vCount[200002];
ll score[200002];
int dfs(int x, int prv = -1){
int result = dfsn[x] = ++dcnt;
seenCnt++;
thisComponent.push(x);
for(auto y: link[x]){
if(prv == y) continue;
if(dfsn[x] > dfsn[y]) stk.push(make_pair(x, y));
if(dfsn[y] > 0) result = min(result, dfsn[y]);
else{
int tmp = dfs(y, x);
result = min(result, tmp);
if(tmp >= dfsn[x]){
vector<pair<int, int> > currBCC;
while(!stk.empty() && stk.top() != make_pair(x, y)){
currBCC.push_back(stk.top());
stk.pop();
}
currBCC.push_back(stk.top());
stk.pop();
BCC.push_back(currBCC);
for(auto p: currBCC){
bccIdx[p.first].push_back((int)BCC.size());
bccIdx[p.second].push_back((int)BCC.size());
}
}
}
}
return result;
}
void makeBCC(){
for(int i=1; i<=n; i++){
if(!dfsn[i]){
seenCnt = 0;
dfs(i);
ans += c3(seenCnt) * 6;
while(!thisComponent.empty()){
con[thisComponent.top()] = seenCnt;
thisComponent.pop();
}
}
}
k = (int)BCC.size(); /// 트리의 정점 개수: n+k
for(int i=1; i<=n; i++){
sort(bccIdx[i].begin(), bccIdx[i].end());
bccIdx[i].erase(unique(bccIdx[i].begin(), bccIdx[i].end()), bccIdx[i].end());
for(auto g: bccIdx[i]){
tlink[i].push_back(g+n);
tlink[g+n].push_back(i);
con[g+n] = con[i];
}
}
}
bool visited[200002];
void dfs2(int x, int prv = -1){
if(x<=n) vCount[x]++;
visited[x] = 1;
for(auto y: tlink[x]){
if(y == prv) continue;
dfs2(y, x);
vCount[x] += vCount[y];
if(x>n){
score[x] += c2(vCount[y]);
}
}
if(x>n) score[x] += c2(con[x] - vCount[x]);
}
void vertexCount(){
for(int i=1; i<=n+k; i++){
if(!visited[i]){
dfs2(i);
}
}
}
void dfs3(int x, int prv = -1){
visited[x] = 1;
for(auto y: tlink[x]){
if(y == prv) continue;
dfs3(y, x);
if(x<=n){
assert(y>n);
ans -= (score[y] - c2(con[x] - vCount[y])) * 2;
}
}
if(x<=n && prv != -1){
ans -= (score[prv] - c2(vCount[x])) * 2;
}
}
void lastDFS(){
fill(visited+1, visited+n+k+1, 0);
for(int i=1; i<=n+k; i++){
if(!visited[i]){
dfs3(i);
}
}
}
Compilation message
count_triplets.cpp: In function 'void input()':
count_triplets.cpp:28:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
28 | scanf("%d %d", &n, &m);
| ~~~~~^~~~~~~~~~~~~~~~~
count_triplets.cpp:31:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
31 | scanf("%d %d", &x, &y);
| ~~~~~^~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9724 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9712 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9676 KB |
Output is correct |
10 |
Correct |
6 ms |
9676 KB |
Output is correct |
11 |
Correct |
6 ms |
9704 KB |
Output is correct |
12 |
Correct |
5 ms |
9672 KB |
Output is correct |
13 |
Correct |
5 ms |
9676 KB |
Output is correct |
14 |
Correct |
6 ms |
9676 KB |
Output is correct |
15 |
Correct |
5 ms |
9628 KB |
Output is correct |
16 |
Correct |
5 ms |
9728 KB |
Output is correct |
17 |
Correct |
6 ms |
9676 KB |
Output is correct |
18 |
Correct |
6 ms |
9660 KB |
Output is correct |
19 |
Correct |
5 ms |
9676 KB |
Output is correct |
20 |
Correct |
6 ms |
9804 KB |
Output is correct |
21 |
Correct |
6 ms |
9676 KB |
Output is correct |
22 |
Correct |
6 ms |
9712 KB |
Output is correct |
23 |
Correct |
5 ms |
9676 KB |
Output is correct |
24 |
Correct |
6 ms |
9712 KB |
Output is correct |
25 |
Correct |
7 ms |
9676 KB |
Output is correct |
26 |
Correct |
6 ms |
9704 KB |
Output is correct |
27 |
Correct |
6 ms |
9700 KB |
Output is correct |
28 |
Correct |
7 ms |
9676 KB |
Output is correct |
29 |
Correct |
6 ms |
9676 KB |
Output is correct |
30 |
Correct |
5 ms |
9708 KB |
Output is correct |
31 |
Correct |
5 ms |
9712 KB |
Output is correct |
32 |
Correct |
5 ms |
9676 KB |
Output is correct |
33 |
Correct |
6 ms |
9692 KB |
Output is correct |
34 |
Correct |
5 ms |
9676 KB |
Output is correct |
35 |
Correct |
6 ms |
9676 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9724 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9712 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9676 KB |
Output is correct |
10 |
Correct |
6 ms |
9676 KB |
Output is correct |
11 |
Correct |
6 ms |
9704 KB |
Output is correct |
12 |
Correct |
5 ms |
9672 KB |
Output is correct |
13 |
Correct |
5 ms |
9676 KB |
Output is correct |
14 |
Correct |
6 ms |
9676 KB |
Output is correct |
15 |
Correct |
5 ms |
9628 KB |
Output is correct |
16 |
Correct |
5 ms |
9728 KB |
Output is correct |
17 |
Correct |
6 ms |
9676 KB |
Output is correct |
18 |
Correct |
6 ms |
9660 KB |
Output is correct |
19 |
Correct |
5 ms |
9676 KB |
Output is correct |
20 |
Correct |
6 ms |
9804 KB |
Output is correct |
21 |
Correct |
6 ms |
9676 KB |
Output is correct |
22 |
Correct |
6 ms |
9712 KB |
Output is correct |
23 |
Correct |
5 ms |
9676 KB |
Output is correct |
24 |
Correct |
6 ms |
9712 KB |
Output is correct |
25 |
Correct |
7 ms |
9676 KB |
Output is correct |
26 |
Correct |
6 ms |
9704 KB |
Output is correct |
27 |
Correct |
6 ms |
9700 KB |
Output is correct |
28 |
Correct |
7 ms |
9676 KB |
Output is correct |
29 |
Correct |
6 ms |
9676 KB |
Output is correct |
30 |
Correct |
5 ms |
9708 KB |
Output is correct |
31 |
Correct |
5 ms |
9712 KB |
Output is correct |
32 |
Correct |
5 ms |
9676 KB |
Output is correct |
33 |
Correct |
6 ms |
9692 KB |
Output is correct |
34 |
Correct |
5 ms |
9676 KB |
Output is correct |
35 |
Correct |
6 ms |
9676 KB |
Output is correct |
36 |
Correct |
6 ms |
9832 KB |
Output is correct |
37 |
Correct |
6 ms |
9800 KB |
Output is correct |
38 |
Correct |
7 ms |
9624 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
6 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
6 ms |
9676 KB |
Output is correct |
44 |
Correct |
6 ms |
9676 KB |
Output is correct |
45 |
Correct |
6 ms |
9676 KB |
Output is correct |
46 |
Correct |
6 ms |
9676 KB |
Output is correct |
47 |
Correct |
5 ms |
9676 KB |
Output is correct |
48 |
Correct |
6 ms |
9676 KB |
Output is correct |
49 |
Correct |
6 ms |
9660 KB |
Output is correct |
50 |
Correct |
5 ms |
9676 KB |
Output is correct |
51 |
Correct |
5 ms |
9676 KB |
Output is correct |
52 |
Correct |
6 ms |
9620 KB |
Output is correct |
53 |
Correct |
6 ms |
9724 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
6 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9676 KB |
Output is correct |
57 |
Correct |
6 ms |
9712 KB |
Output is correct |
58 |
Correct |
6 ms |
9676 KB |
Output is correct |
59 |
Correct |
6 ms |
9676 KB |
Output is correct |
60 |
Correct |
6 ms |
9676 KB |
Output is correct |
61 |
Correct |
6 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9676 KB |
Output is correct |
63 |
Correct |
6 ms |
9648 KB |
Output is correct |
64 |
Correct |
6 ms |
9676 KB |
Output is correct |
65 |
Correct |
6 ms |
9676 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
100 ms |
36416 KB |
Output is correct |
2 |
Correct |
110 ms |
36788 KB |
Output is correct |
3 |
Correct |
186 ms |
34904 KB |
Output is correct |
4 |
Correct |
135 ms |
35764 KB |
Output is correct |
5 |
Correct |
138 ms |
31048 KB |
Output is correct |
6 |
Correct |
173 ms |
33432 KB |
Output is correct |
7 |
Correct |
177 ms |
31660 KB |
Output is correct |
8 |
Correct |
167 ms |
32524 KB |
Output is correct |
9 |
Correct |
179 ms |
30344 KB |
Output is correct |
10 |
Correct |
161 ms |
30320 KB |
Output is correct |
11 |
Correct |
154 ms |
27040 KB |
Output is correct |
12 |
Correct |
176 ms |
26652 KB |
Output is correct |
13 |
Correct |
135 ms |
26484 KB |
Output is correct |
14 |
Correct |
135 ms |
26136 KB |
Output is correct |
15 |
Correct |
92 ms |
24340 KB |
Output is correct |
16 |
Correct |
91 ms |
23828 KB |
Output is correct |
17 |
Correct |
10 ms |
11724 KB |
Output is correct |
18 |
Correct |
12 ms |
11728 KB |
Output is correct |
19 |
Correct |
10 ms |
11756 KB |
Output is correct |
20 |
Correct |
10 ms |
11724 KB |
Output is correct |
21 |
Correct |
10 ms |
11724 KB |
Output is correct |
22 |
Correct |
9 ms |
11724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9932 KB |
Output is correct |
2 |
Correct |
6 ms |
9932 KB |
Output is correct |
3 |
Correct |
6 ms |
9956 KB |
Output is correct |
4 |
Correct |
7 ms |
10060 KB |
Output is correct |
5 |
Correct |
7 ms |
9972 KB |
Output is correct |
6 |
Correct |
7 ms |
9968 KB |
Output is correct |
7 |
Correct |
7 ms |
9932 KB |
Output is correct |
8 |
Correct |
7 ms |
9932 KB |
Output is correct |
9 |
Correct |
7 ms |
9932 KB |
Output is correct |
10 |
Correct |
8 ms |
9932 KB |
Output is correct |
11 |
Correct |
8 ms |
9932 KB |
Output is correct |
12 |
Correct |
7 ms |
9936 KB |
Output is correct |
13 |
Correct |
7 ms |
9964 KB |
Output is correct |
14 |
Correct |
7 ms |
9840 KB |
Output is correct |
15 |
Correct |
7 ms |
9928 KB |
Output is correct |
16 |
Correct |
6 ms |
9832 KB |
Output is correct |
17 |
Correct |
6 ms |
9932 KB |
Output is correct |
18 |
Correct |
6 ms |
9932 KB |
Output is correct |
19 |
Correct |
8 ms |
9976 KB |
Output is correct |
20 |
Correct |
6 ms |
9948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
196 ms |
32544 KB |
Output is correct |
2 |
Correct |
190 ms |
32880 KB |
Output is correct |
3 |
Correct |
203 ms |
33048 KB |
Output is correct |
4 |
Correct |
215 ms |
32840 KB |
Output is correct |
5 |
Correct |
196 ms |
32820 KB |
Output is correct |
6 |
Correct |
217 ms |
41196 KB |
Output is correct |
7 |
Correct |
226 ms |
38236 KB |
Output is correct |
8 |
Correct |
211 ms |
36844 KB |
Output is correct |
9 |
Correct |
258 ms |
35388 KB |
Output is correct |
10 |
Correct |
187 ms |
32880 KB |
Output is correct |
11 |
Correct |
194 ms |
32840 KB |
Output is correct |
12 |
Correct |
235 ms |
33004 KB |
Output is correct |
13 |
Correct |
195 ms |
32904 KB |
Output is correct |
14 |
Correct |
182 ms |
31636 KB |
Output is correct |
15 |
Correct |
154 ms |
29960 KB |
Output is correct |
16 |
Correct |
95 ms |
24684 KB |
Output is correct |
17 |
Correct |
184 ms |
33700 KB |
Output is correct |
18 |
Correct |
163 ms |
33692 KB |
Output is correct |
19 |
Correct |
168 ms |
33692 KB |
Output is correct |
20 |
Correct |
167 ms |
33780 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9932 KB |
Output is correct |
2 |
Correct |
7 ms |
9960 KB |
Output is correct |
3 |
Correct |
7 ms |
9936 KB |
Output is correct |
4 |
Correct |
6 ms |
9932 KB |
Output is correct |
5 |
Correct |
7 ms |
9800 KB |
Output is correct |
6 |
Correct |
6 ms |
9804 KB |
Output is correct |
7 |
Correct |
7 ms |
9804 KB |
Output is correct |
8 |
Correct |
6 ms |
9804 KB |
Output is correct |
9 |
Correct |
7 ms |
9804 KB |
Output is correct |
10 |
Correct |
7 ms |
9840 KB |
Output is correct |
11 |
Correct |
7 ms |
9804 KB |
Output is correct |
12 |
Correct |
7 ms |
9932 KB |
Output is correct |
13 |
Correct |
6 ms |
9972 KB |
Output is correct |
14 |
Correct |
8 ms |
9968 KB |
Output is correct |
15 |
Correct |
7 ms |
9932 KB |
Output is correct |
16 |
Correct |
7 ms |
9844 KB |
Output is correct |
17 |
Correct |
7 ms |
9836 KB |
Output is correct |
18 |
Correct |
7 ms |
9932 KB |
Output is correct |
19 |
Correct |
7 ms |
9840 KB |
Output is correct |
20 |
Correct |
7 ms |
9808 KB |
Output is correct |
21 |
Correct |
7 ms |
9840 KB |
Output is correct |
22 |
Correct |
7 ms |
9964 KB |
Output is correct |
23 |
Correct |
6 ms |
9932 KB |
Output is correct |
24 |
Correct |
7 ms |
9840 KB |
Output is correct |
25 |
Correct |
7 ms |
9808 KB |
Output is correct |
26 |
Correct |
7 ms |
9676 KB |
Output is correct |
27 |
Correct |
6 ms |
9704 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
199 ms |
32548 KB |
Output is correct |
2 |
Correct |
211 ms |
32744 KB |
Output is correct |
3 |
Correct |
224 ms |
30812 KB |
Output is correct |
4 |
Correct |
198 ms |
28556 KB |
Output is correct |
5 |
Correct |
149 ms |
26124 KB |
Output is correct |
6 |
Correct |
139 ms |
25164 KB |
Output is correct |
7 |
Correct |
139 ms |
24664 KB |
Output is correct |
8 |
Correct |
130 ms |
24092 KB |
Output is correct |
9 |
Correct |
131 ms |
23840 KB |
Output is correct |
10 |
Correct |
122 ms |
23620 KB |
Output is correct |
11 |
Correct |
129 ms |
23392 KB |
Output is correct |
12 |
Correct |
112 ms |
23352 KB |
Output is correct |
13 |
Correct |
117 ms |
23452 KB |
Output is correct |
14 |
Correct |
109 ms |
26608 KB |
Output is correct |
15 |
Correct |
219 ms |
36980 KB |
Output is correct |
16 |
Correct |
227 ms |
34768 KB |
Output is correct |
17 |
Correct |
225 ms |
34804 KB |
Output is correct |
18 |
Correct |
195 ms |
33004 KB |
Output is correct |
19 |
Correct |
191 ms |
28656 KB |
Output is correct |
20 |
Correct |
169 ms |
28576 KB |
Output is correct |
21 |
Correct |
184 ms |
28588 KB |
Output is correct |
22 |
Correct |
211 ms |
27296 KB |
Output is correct |
23 |
Correct |
136 ms |
26032 KB |
Output is correct |
24 |
Correct |
184 ms |
31348 KB |
Output is correct |
25 |
Correct |
217 ms |
31468 KB |
Output is correct |
26 |
Correct |
188 ms |
29928 KB |
Output is correct |
27 |
Correct |
185 ms |
29964 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9724 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9712 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9676 KB |
Output is correct |
10 |
Correct |
6 ms |
9676 KB |
Output is correct |
11 |
Correct |
6 ms |
9704 KB |
Output is correct |
12 |
Correct |
5 ms |
9672 KB |
Output is correct |
13 |
Correct |
5 ms |
9676 KB |
Output is correct |
14 |
Correct |
6 ms |
9676 KB |
Output is correct |
15 |
Correct |
5 ms |
9628 KB |
Output is correct |
16 |
Correct |
5 ms |
9728 KB |
Output is correct |
17 |
Correct |
6 ms |
9676 KB |
Output is correct |
18 |
Correct |
6 ms |
9660 KB |
Output is correct |
19 |
Correct |
5 ms |
9676 KB |
Output is correct |
20 |
Correct |
6 ms |
9804 KB |
Output is correct |
21 |
Correct |
6 ms |
9676 KB |
Output is correct |
22 |
Correct |
6 ms |
9712 KB |
Output is correct |
23 |
Correct |
5 ms |
9676 KB |
Output is correct |
24 |
Correct |
6 ms |
9712 KB |
Output is correct |
25 |
Correct |
7 ms |
9676 KB |
Output is correct |
26 |
Correct |
6 ms |
9704 KB |
Output is correct |
27 |
Correct |
6 ms |
9700 KB |
Output is correct |
28 |
Correct |
7 ms |
9676 KB |
Output is correct |
29 |
Correct |
6 ms |
9676 KB |
Output is correct |
30 |
Correct |
5 ms |
9708 KB |
Output is correct |
31 |
Correct |
5 ms |
9712 KB |
Output is correct |
32 |
Correct |
5 ms |
9676 KB |
Output is correct |
33 |
Correct |
6 ms |
9692 KB |
Output is correct |
34 |
Correct |
5 ms |
9676 KB |
Output is correct |
35 |
Correct |
6 ms |
9676 KB |
Output is correct |
36 |
Correct |
6 ms |
9832 KB |
Output is correct |
37 |
Correct |
6 ms |
9800 KB |
Output is correct |
38 |
Correct |
7 ms |
9624 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
6 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
6 ms |
9676 KB |
Output is correct |
44 |
Correct |
6 ms |
9676 KB |
Output is correct |
45 |
Correct |
6 ms |
9676 KB |
Output is correct |
46 |
Correct |
6 ms |
9676 KB |
Output is correct |
47 |
Correct |
5 ms |
9676 KB |
Output is correct |
48 |
Correct |
6 ms |
9676 KB |
Output is correct |
49 |
Correct |
6 ms |
9660 KB |
Output is correct |
50 |
Correct |
5 ms |
9676 KB |
Output is correct |
51 |
Correct |
5 ms |
9676 KB |
Output is correct |
52 |
Correct |
6 ms |
9620 KB |
Output is correct |
53 |
Correct |
6 ms |
9724 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
6 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9676 KB |
Output is correct |
57 |
Correct |
6 ms |
9712 KB |
Output is correct |
58 |
Correct |
6 ms |
9676 KB |
Output is correct |
59 |
Correct |
6 ms |
9676 KB |
Output is correct |
60 |
Correct |
6 ms |
9676 KB |
Output is correct |
61 |
Correct |
6 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9676 KB |
Output is correct |
63 |
Correct |
6 ms |
9648 KB |
Output is correct |
64 |
Correct |
6 ms |
9676 KB |
Output is correct |
65 |
Correct |
6 ms |
9676 KB |
Output is correct |
66 |
Correct |
6 ms |
9676 KB |
Output is correct |
67 |
Correct |
8 ms |
9840 KB |
Output is correct |
68 |
Correct |
7 ms |
9844 KB |
Output is correct |
69 |
Correct |
6 ms |
9848 KB |
Output is correct |
70 |
Correct |
7 ms |
9932 KB |
Output is correct |
71 |
Correct |
6 ms |
9804 KB |
Output is correct |
72 |
Correct |
7 ms |
9808 KB |
Output is correct |
73 |
Correct |
7 ms |
9844 KB |
Output is correct |
74 |
Correct |
6 ms |
9804 KB |
Output is correct |
75 |
Correct |
6 ms |
9804 KB |
Output is correct |
76 |
Correct |
6 ms |
9676 KB |
Output is correct |
77 |
Correct |
7 ms |
9932 KB |
Output is correct |
78 |
Correct |
7 ms |
9808 KB |
Output is correct |
79 |
Correct |
6 ms |
9844 KB |
Output is correct |
80 |
Correct |
7 ms |
9804 KB |
Output is correct |
81 |
Correct |
6 ms |
9804 KB |
Output is correct |
82 |
Correct |
7 ms |
9964 KB |
Output is correct |
83 |
Correct |
8 ms |
9964 KB |
Output is correct |
84 |
Correct |
7 ms |
9932 KB |
Output is correct |
85 |
Correct |
7 ms |
9932 KB |
Output is correct |
86 |
Correct |
7 ms |
9804 KB |
Output is correct |
87 |
Correct |
7 ms |
9844 KB |
Output is correct |
88 |
Correct |
8 ms |
9804 KB |
Output is correct |
89 |
Correct |
8 ms |
9792 KB |
Output is correct |
90 |
Correct |
7 ms |
9848 KB |
Output is correct |
91 |
Correct |
7 ms |
9804 KB |
Output is correct |
92 |
Correct |
9 ms |
9840 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
9724 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9708 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9712 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9676 KB |
Output is correct |
10 |
Correct |
6 ms |
9676 KB |
Output is correct |
11 |
Correct |
6 ms |
9704 KB |
Output is correct |
12 |
Correct |
5 ms |
9672 KB |
Output is correct |
13 |
Correct |
5 ms |
9676 KB |
Output is correct |
14 |
Correct |
6 ms |
9676 KB |
Output is correct |
15 |
Correct |
5 ms |
9628 KB |
Output is correct |
16 |
Correct |
5 ms |
9728 KB |
Output is correct |
17 |
Correct |
6 ms |
9676 KB |
Output is correct |
18 |
Correct |
6 ms |
9660 KB |
Output is correct |
19 |
Correct |
5 ms |
9676 KB |
Output is correct |
20 |
Correct |
6 ms |
9804 KB |
Output is correct |
21 |
Correct |
6 ms |
9676 KB |
Output is correct |
22 |
Correct |
6 ms |
9712 KB |
Output is correct |
23 |
Correct |
5 ms |
9676 KB |
Output is correct |
24 |
Correct |
6 ms |
9712 KB |
Output is correct |
25 |
Correct |
7 ms |
9676 KB |
Output is correct |
26 |
Correct |
6 ms |
9704 KB |
Output is correct |
27 |
Correct |
6 ms |
9700 KB |
Output is correct |
28 |
Correct |
7 ms |
9676 KB |
Output is correct |
29 |
Correct |
6 ms |
9676 KB |
Output is correct |
30 |
Correct |
5 ms |
9708 KB |
Output is correct |
31 |
Correct |
5 ms |
9712 KB |
Output is correct |
32 |
Correct |
5 ms |
9676 KB |
Output is correct |
33 |
Correct |
6 ms |
9692 KB |
Output is correct |
34 |
Correct |
5 ms |
9676 KB |
Output is correct |
35 |
Correct |
6 ms |
9676 KB |
Output is correct |
36 |
Correct |
6 ms |
9832 KB |
Output is correct |
37 |
Correct |
6 ms |
9800 KB |
Output is correct |
38 |
Correct |
7 ms |
9624 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
6 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
6 ms |
9676 KB |
Output is correct |
44 |
Correct |
6 ms |
9676 KB |
Output is correct |
45 |
Correct |
6 ms |
9676 KB |
Output is correct |
46 |
Correct |
6 ms |
9676 KB |
Output is correct |
47 |
Correct |
5 ms |
9676 KB |
Output is correct |
48 |
Correct |
6 ms |
9676 KB |
Output is correct |
49 |
Correct |
6 ms |
9660 KB |
Output is correct |
50 |
Correct |
5 ms |
9676 KB |
Output is correct |
51 |
Correct |
5 ms |
9676 KB |
Output is correct |
52 |
Correct |
6 ms |
9620 KB |
Output is correct |
53 |
Correct |
6 ms |
9724 KB |
Output is correct |
54 |
Correct |
6 ms |
9708 KB |
Output is correct |
55 |
Correct |
6 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9676 KB |
Output is correct |
57 |
Correct |
6 ms |
9712 KB |
Output is correct |
58 |
Correct |
6 ms |
9676 KB |
Output is correct |
59 |
Correct |
6 ms |
9676 KB |
Output is correct |
60 |
Correct |
6 ms |
9676 KB |
Output is correct |
61 |
Correct |
6 ms |
9708 KB |
Output is correct |
62 |
Correct |
6 ms |
9676 KB |
Output is correct |
63 |
Correct |
6 ms |
9648 KB |
Output is correct |
64 |
Correct |
6 ms |
9676 KB |
Output is correct |
65 |
Correct |
6 ms |
9676 KB |
Output is correct |
66 |
Correct |
100 ms |
36416 KB |
Output is correct |
67 |
Correct |
110 ms |
36788 KB |
Output is correct |
68 |
Correct |
186 ms |
34904 KB |
Output is correct |
69 |
Correct |
135 ms |
35764 KB |
Output is correct |
70 |
Correct |
138 ms |
31048 KB |
Output is correct |
71 |
Correct |
173 ms |
33432 KB |
Output is correct |
72 |
Correct |
177 ms |
31660 KB |
Output is correct |
73 |
Correct |
167 ms |
32524 KB |
Output is correct |
74 |
Correct |
179 ms |
30344 KB |
Output is correct |
75 |
Correct |
161 ms |
30320 KB |
Output is correct |
76 |
Correct |
154 ms |
27040 KB |
Output is correct |
77 |
Correct |
176 ms |
26652 KB |
Output is correct |
78 |
Correct |
135 ms |
26484 KB |
Output is correct |
79 |
Correct |
135 ms |
26136 KB |
Output is correct |
80 |
Correct |
92 ms |
24340 KB |
Output is correct |
81 |
Correct |
91 ms |
23828 KB |
Output is correct |
82 |
Correct |
10 ms |
11724 KB |
Output is correct |
83 |
Correct |
12 ms |
11728 KB |
Output is correct |
84 |
Correct |
10 ms |
11756 KB |
Output is correct |
85 |
Correct |
10 ms |
11724 KB |
Output is correct |
86 |
Correct |
10 ms |
11724 KB |
Output is correct |
87 |
Correct |
9 ms |
11724 KB |
Output is correct |
88 |
Correct |
6 ms |
9932 KB |
Output is correct |
89 |
Correct |
6 ms |
9932 KB |
Output is correct |
90 |
Correct |
6 ms |
9956 KB |
Output is correct |
91 |
Correct |
7 ms |
10060 KB |
Output is correct |
92 |
Correct |
7 ms |
9972 KB |
Output is correct |
93 |
Correct |
7 ms |
9968 KB |
Output is correct |
94 |
Correct |
7 ms |
9932 KB |
Output is correct |
95 |
Correct |
7 ms |
9932 KB |
Output is correct |
96 |
Correct |
7 ms |
9932 KB |
Output is correct |
97 |
Correct |
8 ms |
9932 KB |
Output is correct |
98 |
Correct |
8 ms |
9932 KB |
Output is correct |
99 |
Correct |
7 ms |
9936 KB |
Output is correct |
100 |
Correct |
7 ms |
9964 KB |
Output is correct |
101 |
Correct |
7 ms |
9840 KB |
Output is correct |
102 |
Correct |
7 ms |
9928 KB |
Output is correct |
103 |
Correct |
6 ms |
9832 KB |
Output is correct |
104 |
Correct |
6 ms |
9932 KB |
Output is correct |
105 |
Correct |
6 ms |
9932 KB |
Output is correct |
106 |
Correct |
8 ms |
9976 KB |
Output is correct |
107 |
Correct |
6 ms |
9948 KB |
Output is correct |
108 |
Correct |
196 ms |
32544 KB |
Output is correct |
109 |
Correct |
190 ms |
32880 KB |
Output is correct |
110 |
Correct |
203 ms |
33048 KB |
Output is correct |
111 |
Correct |
215 ms |
32840 KB |
Output is correct |
112 |
Correct |
196 ms |
32820 KB |
Output is correct |
113 |
Correct |
217 ms |
41196 KB |
Output is correct |
114 |
Correct |
226 ms |
38236 KB |
Output is correct |
115 |
Correct |
211 ms |
36844 KB |
Output is correct |
116 |
Correct |
258 ms |
35388 KB |
Output is correct |
117 |
Correct |
187 ms |
32880 KB |
Output is correct |
118 |
Correct |
194 ms |
32840 KB |
Output is correct |
119 |
Correct |
235 ms |
33004 KB |
Output is correct |
120 |
Correct |
195 ms |
32904 KB |
Output is correct |
121 |
Correct |
182 ms |
31636 KB |
Output is correct |
122 |
Correct |
154 ms |
29960 KB |
Output is correct |
123 |
Correct |
95 ms |
24684 KB |
Output is correct |
124 |
Correct |
184 ms |
33700 KB |
Output is correct |
125 |
Correct |
163 ms |
33692 KB |
Output is correct |
126 |
Correct |
168 ms |
33692 KB |
Output is correct |
127 |
Correct |
167 ms |
33780 KB |
Output is correct |
128 |
Correct |
6 ms |
9932 KB |
Output is correct |
129 |
Correct |
7 ms |
9960 KB |
Output is correct |
130 |
Correct |
7 ms |
9936 KB |
Output is correct |
131 |
Correct |
6 ms |
9932 KB |
Output is correct |
132 |
Correct |
7 ms |
9800 KB |
Output is correct |
133 |
Correct |
6 ms |
9804 KB |
Output is correct |
134 |
Correct |
7 ms |
9804 KB |
Output is correct |
135 |
Correct |
6 ms |
9804 KB |
Output is correct |
136 |
Correct |
7 ms |
9804 KB |
Output is correct |
137 |
Correct |
7 ms |
9840 KB |
Output is correct |
138 |
Correct |
7 ms |
9804 KB |
Output is correct |
139 |
Correct |
7 ms |
9932 KB |
Output is correct |
140 |
Correct |
6 ms |
9972 KB |
Output is correct |
141 |
Correct |
8 ms |
9968 KB |
Output is correct |
142 |
Correct |
7 ms |
9932 KB |
Output is correct |
143 |
Correct |
7 ms |
9844 KB |
Output is correct |
144 |
Correct |
7 ms |
9836 KB |
Output is correct |
145 |
Correct |
7 ms |
9932 KB |
Output is correct |
146 |
Correct |
7 ms |
9840 KB |
Output is correct |
147 |
Correct |
7 ms |
9808 KB |
Output is correct |
148 |
Correct |
7 ms |
9840 KB |
Output is correct |
149 |
Correct |
7 ms |
9964 KB |
Output is correct |
150 |
Correct |
6 ms |
9932 KB |
Output is correct |
151 |
Correct |
7 ms |
9840 KB |
Output is correct |
152 |
Correct |
7 ms |
9808 KB |
Output is correct |
153 |
Correct |
7 ms |
9676 KB |
Output is correct |
154 |
Correct |
6 ms |
9704 KB |
Output is correct |
155 |
Correct |
199 ms |
32548 KB |
Output is correct |
156 |
Correct |
211 ms |
32744 KB |
Output is correct |
157 |
Correct |
224 ms |
30812 KB |
Output is correct |
158 |
Correct |
198 ms |
28556 KB |
Output is correct |
159 |
Correct |
149 ms |
26124 KB |
Output is correct |
160 |
Correct |
139 ms |
25164 KB |
Output is correct |
161 |
Correct |
139 ms |
24664 KB |
Output is correct |
162 |
Correct |
130 ms |
24092 KB |
Output is correct |
163 |
Correct |
131 ms |
23840 KB |
Output is correct |
164 |
Correct |
122 ms |
23620 KB |
Output is correct |
165 |
Correct |
129 ms |
23392 KB |
Output is correct |
166 |
Correct |
112 ms |
23352 KB |
Output is correct |
167 |
Correct |
117 ms |
23452 KB |
Output is correct |
168 |
Correct |
109 ms |
26608 KB |
Output is correct |
169 |
Correct |
219 ms |
36980 KB |
Output is correct |
170 |
Correct |
227 ms |
34768 KB |
Output is correct |
171 |
Correct |
225 ms |
34804 KB |
Output is correct |
172 |
Correct |
195 ms |
33004 KB |
Output is correct |
173 |
Correct |
191 ms |
28656 KB |
Output is correct |
174 |
Correct |
169 ms |
28576 KB |
Output is correct |
175 |
Correct |
184 ms |
28588 KB |
Output is correct |
176 |
Correct |
211 ms |
27296 KB |
Output is correct |
177 |
Correct |
136 ms |
26032 KB |
Output is correct |
178 |
Correct |
184 ms |
31348 KB |
Output is correct |
179 |
Correct |
217 ms |
31468 KB |
Output is correct |
180 |
Correct |
188 ms |
29928 KB |
Output is correct |
181 |
Correct |
185 ms |
29964 KB |
Output is correct |
182 |
Correct |
6 ms |
9676 KB |
Output is correct |
183 |
Correct |
8 ms |
9840 KB |
Output is correct |
184 |
Correct |
7 ms |
9844 KB |
Output is correct |
185 |
Correct |
6 ms |
9848 KB |
Output is correct |
186 |
Correct |
7 ms |
9932 KB |
Output is correct |
187 |
Correct |
6 ms |
9804 KB |
Output is correct |
188 |
Correct |
7 ms |
9808 KB |
Output is correct |
189 |
Correct |
7 ms |
9844 KB |
Output is correct |
190 |
Correct |
6 ms |
9804 KB |
Output is correct |
191 |
Correct |
6 ms |
9804 KB |
Output is correct |
192 |
Correct |
6 ms |
9676 KB |
Output is correct |
193 |
Correct |
7 ms |
9932 KB |
Output is correct |
194 |
Correct |
7 ms |
9808 KB |
Output is correct |
195 |
Correct |
6 ms |
9844 KB |
Output is correct |
196 |
Correct |
7 ms |
9804 KB |
Output is correct |
197 |
Correct |
6 ms |
9804 KB |
Output is correct |
198 |
Correct |
7 ms |
9964 KB |
Output is correct |
199 |
Correct |
8 ms |
9964 KB |
Output is correct |
200 |
Correct |
7 ms |
9932 KB |
Output is correct |
201 |
Correct |
7 ms |
9932 KB |
Output is correct |
202 |
Correct |
7 ms |
9804 KB |
Output is correct |
203 |
Correct |
7 ms |
9844 KB |
Output is correct |
204 |
Correct |
8 ms |
9804 KB |
Output is correct |
205 |
Correct |
8 ms |
9792 KB |
Output is correct |
206 |
Correct |
7 ms |
9848 KB |
Output is correct |
207 |
Correct |
7 ms |
9804 KB |
Output is correct |
208 |
Correct |
9 ms |
9840 KB |
Output is correct |
209 |
Correct |
10 ms |
11756 KB |
Output is correct |
210 |
Correct |
95 ms |
23576 KB |
Output is correct |
211 |
Correct |
146 ms |
28836 KB |
Output is correct |
212 |
Correct |
157 ms |
31728 KB |
Output is correct |
213 |
Correct |
169 ms |
33832 KB |
Output is correct |
214 |
Correct |
87 ms |
25972 KB |
Output is correct |
215 |
Correct |
90 ms |
25132 KB |
Output is correct |
216 |
Correct |
183 ms |
29692 KB |
Output is correct |
217 |
Correct |
170 ms |
26804 KB |
Output is correct |
218 |
Correct |
129 ms |
24064 KB |
Output is correct |
219 |
Correct |
119 ms |
23492 KB |
Output is correct |
220 |
Correct |
117 ms |
23384 KB |
Output is correct |
221 |
Correct |
111 ms |
23300 KB |
Output is correct |
222 |
Correct |
117 ms |
24932 KB |
Output is correct |
223 |
Correct |
177 ms |
30432 KB |
Output is correct |
224 |
Correct |
185 ms |
29168 KB |
Output is correct |
225 |
Correct |
161 ms |
26108 KB |
Output is correct |
226 |
Correct |
173 ms |
26104 KB |
Output is correct |
227 |
Correct |
159 ms |
26020 KB |
Output is correct |
228 |
Correct |
147 ms |
25332 KB |
Output is correct |
229 |
Correct |
129 ms |
24932 KB |
Output is correct |
230 |
Correct |
172 ms |
27036 KB |
Output is correct |
231 |
Correct |
170 ms |
27148 KB |
Output is correct |