#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 4e5 + 21, MOD = (int)1e9+7;
int n,m;
bool isb[N];
vector<vector<int>> bcc(vector<vector<int>> &g,vector<int> &sz){
vector<bool> ap(n+1,0);
vector<int> tin(n+1,0),up(n+1,0),id(n+1,0);
vector<int> stk;
vector<vector<int>> comps,G;
function <void(int,int,int&)> dfs = [&](int v,int pr,int &t){
tin[v] = up[v] = ++t;
stk.push_back(v);
int cc =0;
for(int to:g[v]){
if(to == pr)continue;
if(!tin[to]){
dfs(to,v,t);
cc++;
up[v] = min(up[v],up[to]);
if(up[to] >= tin[v]){
if(pr != -1){
ap[v] = 1;
}
comps.push_back({v});
while(comps.back().back() != to){
comps.back().push_back(stk.back());
stk.pop_back();
}
}
}else{
up[v] = min(up[v],tin[to]);
}
}
if(pr == -1){
ap[v] = (cc > 1);
}
};
int timer = 0;
for(int i = 1;i <= n;i++){
if(!tin[i]){
dfs(i,-1,timer);
}
}
function<vector<vector<int>>()> build_tree = [&]() {
vector<vector<int>> t(1);
int it = 0;
sz = vector<int> (1,0);
for(int i = 1;i <= n;i++){
if(ap[i]){
id[i] = ++it;
sz.push_back(1);
sz[id[i]] = 1;
t.push_back({});
}
}
for(auto c:comps){
it++;
isb[it] = 1;
sz.push_back(0);
t.push_back({});
for(auto j:c){
// cout << j << ' ';
if(ap[j]){
t[id[j]].push_back(it);
t[it].push_back(id[j]);
}else{
id[j] = it;
sz[it]++;
}
}
// cout << '\n';
}
return t;
};
return build_tree();
}
vector<vector<int>> g(N),G;
ll calc(vector<int> &S){
ll s = 0,d = 0,t = 0;
for(auto i:S){
t += i *1ll * d;
d += s * 1ll * i;
s += i;
}
return t;
}
int bf_n,nn = 0;
vector<int> sz;
bool vis[N];
ll ss[N];
void prec(int v,int pr = -1){
vis[v] = 1;
ss[v] += sz[v];
for(int to:G[v]){
if(to == pr)continue;
prec(to,v);
ss[v] += ss[to];
}
}
ll res = 0;
void clac(int v,int pr = -1){
ll c = sz[v] * 1ll * (sz[v] - 1);
res += c / 2 *1ll * (sz[v] - 2 + (int)G[v].size());
res += c * 1ll * (nn - sz[v]);
vector<ll> vals;
for(int to:G[v]){
if(to == pr){
vals.push_back(nn-ss[v]);
continue;
}
clac(to,v);
vals.push_back(ss[to]);
}
ll D = 0,S = 0;
ll T = (int)G[v].size();
if(isb[v]){
// res += T * (T - 1) / 2 * (T - 2);
}
for(ll i:vals){
D += i * S;
S += i;
}
for(int i = 0;i < (int)vals.size();++i){
if(isb[v]){
res += vals[i] *1ll* sz[v]*1ll*((int)vals.size()-1);
ll left = (int)vals.size() - 1;
left = left * (left - 1);
// res += left * (vals[i]);
res += (D - (S - vals[i]) * vals[i]);
}
}
res += D * 1ll * sz[v];
}
void test(){
cin >> n >> m;
for(int i = 1;i <= m;i++){
int u,v;
cin >> u >> v;
g[u].push_back(v);
g[v].push_back(u);
}
G = bcc(g,sz);
// cout << "__________________________________\n";
n = (int)G.size() - 1;
for(int i = 1;i <= n;i++){
// cout << i << ' ' << sz[i] << '\n';
if(!vis[i]){
prec(i);
nn = ss[i];
clac(i);
}
}
cout << res * 2 << '\n';
}
int main() {
ios_base::sync_with_stdio(false);cin.tie(0);
int t = 1;
// cin >> t;
while(t--) {
test();
}
}
Compilation message
count_triplets.cpp: In function 'void clac(int, int)':
count_triplets.cpp:121:8: warning: unused variable 'T' [-Wunused-variable]
121 | ll T = (int)G[v].size();
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9816 KB |
Output is correct |
2 |
Correct |
4 ms |
9820 KB |
Output is correct |
3 |
Correct |
4 ms |
9816 KB |
Output is correct |
4 |
Correct |
5 ms |
9820 KB |
Output is correct |
5 |
Correct |
4 ms |
9876 KB |
Output is correct |
6 |
Correct |
6 ms |
9820 KB |
Output is correct |
7 |
Correct |
5 ms |
9820 KB |
Output is correct |
8 |
Correct |
4 ms |
10072 KB |
Output is correct |
9 |
Correct |
5 ms |
10072 KB |
Output is correct |
10 |
Correct |
4 ms |
9620 KB |
Output is correct |
11 |
Correct |
5 ms |
9820 KB |
Output is correct |
12 |
Correct |
5 ms |
9872 KB |
Output is correct |
13 |
Correct |
4 ms |
9820 KB |
Output is correct |
14 |
Correct |
4 ms |
9816 KB |
Output is correct |
15 |
Correct |
4 ms |
9820 KB |
Output is correct |
16 |
Correct |
5 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9980 KB |
Output is correct |
18 |
Correct |
5 ms |
9820 KB |
Output is correct |
19 |
Correct |
6 ms |
9776 KB |
Output is correct |
20 |
Correct |
4 ms |
9820 KB |
Output is correct |
21 |
Correct |
4 ms |
9820 KB |
Output is correct |
22 |
Correct |
4 ms |
9816 KB |
Output is correct |
23 |
Correct |
5 ms |
9820 KB |
Output is correct |
24 |
Correct |
4 ms |
9820 KB |
Output is correct |
25 |
Correct |
5 ms |
9680 KB |
Output is correct |
26 |
Correct |
4 ms |
9820 KB |
Output is correct |
27 |
Correct |
4 ms |
9820 KB |
Output is correct |
28 |
Correct |
5 ms |
9820 KB |
Output is correct |
29 |
Correct |
4 ms |
9820 KB |
Output is correct |
30 |
Correct |
5 ms |
9820 KB |
Output is correct |
31 |
Correct |
5 ms |
9876 KB |
Output is correct |
32 |
Correct |
4 ms |
9792 KB |
Output is correct |
33 |
Correct |
4 ms |
9820 KB |
Output is correct |
34 |
Correct |
5 ms |
9820 KB |
Output is correct |
35 |
Correct |
4 ms |
9852 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9816 KB |
Output is correct |
2 |
Correct |
4 ms |
9820 KB |
Output is correct |
3 |
Correct |
4 ms |
9816 KB |
Output is correct |
4 |
Correct |
5 ms |
9820 KB |
Output is correct |
5 |
Correct |
4 ms |
9876 KB |
Output is correct |
6 |
Correct |
6 ms |
9820 KB |
Output is correct |
7 |
Correct |
5 ms |
9820 KB |
Output is correct |
8 |
Correct |
4 ms |
10072 KB |
Output is correct |
9 |
Correct |
5 ms |
10072 KB |
Output is correct |
10 |
Correct |
4 ms |
9620 KB |
Output is correct |
11 |
Correct |
5 ms |
9820 KB |
Output is correct |
12 |
Correct |
5 ms |
9872 KB |
Output is correct |
13 |
Correct |
4 ms |
9820 KB |
Output is correct |
14 |
Correct |
4 ms |
9816 KB |
Output is correct |
15 |
Correct |
4 ms |
9820 KB |
Output is correct |
16 |
Correct |
5 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9980 KB |
Output is correct |
18 |
Correct |
5 ms |
9820 KB |
Output is correct |
19 |
Correct |
6 ms |
9776 KB |
Output is correct |
20 |
Correct |
4 ms |
9820 KB |
Output is correct |
21 |
Correct |
4 ms |
9820 KB |
Output is correct |
22 |
Correct |
4 ms |
9816 KB |
Output is correct |
23 |
Correct |
5 ms |
9820 KB |
Output is correct |
24 |
Correct |
4 ms |
9820 KB |
Output is correct |
25 |
Correct |
5 ms |
9680 KB |
Output is correct |
26 |
Correct |
4 ms |
9820 KB |
Output is correct |
27 |
Correct |
4 ms |
9820 KB |
Output is correct |
28 |
Correct |
5 ms |
9820 KB |
Output is correct |
29 |
Correct |
4 ms |
9820 KB |
Output is correct |
30 |
Correct |
5 ms |
9820 KB |
Output is correct |
31 |
Correct |
5 ms |
9876 KB |
Output is correct |
32 |
Correct |
4 ms |
9792 KB |
Output is correct |
33 |
Correct |
4 ms |
9820 KB |
Output is correct |
34 |
Correct |
5 ms |
9820 KB |
Output is correct |
35 |
Correct |
4 ms |
9852 KB |
Output is correct |
36 |
Correct |
4 ms |
9816 KB |
Output is correct |
37 |
Correct |
4 ms |
9820 KB |
Output is correct |
38 |
Correct |
5 ms |
9820 KB |
Output is correct |
39 |
Correct |
4 ms |
9820 KB |
Output is correct |
40 |
Correct |
4 ms |
9820 KB |
Output is correct |
41 |
Correct |
4 ms |
9820 KB |
Output is correct |
42 |
Correct |
4 ms |
9820 KB |
Output is correct |
43 |
Correct |
5 ms |
9820 KB |
Output is correct |
44 |
Correct |
4 ms |
9880 KB |
Output is correct |
45 |
Correct |
4 ms |
9872 KB |
Output is correct |
46 |
Correct |
4 ms |
9820 KB |
Output is correct |
47 |
Correct |
4 ms |
9820 KB |
Output is correct |
48 |
Correct |
5 ms |
9704 KB |
Output is correct |
49 |
Correct |
5 ms |
9820 KB |
Output is correct |
50 |
Correct |
5 ms |
9820 KB |
Output is correct |
51 |
Correct |
4 ms |
9820 KB |
Output is correct |
52 |
Correct |
5 ms |
9820 KB |
Output is correct |
53 |
Correct |
5 ms |
9820 KB |
Output is correct |
54 |
Correct |
4 ms |
9816 KB |
Output is correct |
55 |
Correct |
4 ms |
9820 KB |
Output is correct |
56 |
Correct |
4 ms |
9820 KB |
Output is correct |
57 |
Correct |
4 ms |
9820 KB |
Output is correct |
58 |
Correct |
5 ms |
10076 KB |
Output is correct |
59 |
Correct |
4 ms |
9820 KB |
Output is correct |
60 |
Correct |
4 ms |
9820 KB |
Output is correct |
61 |
Correct |
4 ms |
9820 KB |
Output is correct |
62 |
Correct |
5 ms |
9820 KB |
Output is correct |
63 |
Correct |
4 ms |
9872 KB |
Output is correct |
64 |
Correct |
4 ms |
9656 KB |
Output is correct |
65 |
Correct |
4 ms |
9704 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
30700 KB |
Output is correct |
2 |
Correct |
41 ms |
30788 KB |
Output is correct |
3 |
Correct |
62 ms |
32844 KB |
Output is correct |
4 |
Correct |
50 ms |
30984 KB |
Output is correct |
5 |
Correct |
56 ms |
27788 KB |
Output is correct |
6 |
Correct |
68 ms |
31820 KB |
Output is correct |
7 |
Correct |
63 ms |
29340 KB |
Output is correct |
8 |
Correct |
65 ms |
30188 KB |
Output is correct |
9 |
Correct |
61 ms |
27460 KB |
Output is correct |
10 |
Correct |
58 ms |
26880 KB |
Output is correct |
11 |
Correct |
43 ms |
23104 KB |
Output is correct |
12 |
Correct |
45 ms |
23008 KB |
Output is correct |
13 |
Correct |
39 ms |
22788 KB |
Output is correct |
14 |
Correct |
38 ms |
22800 KB |
Output is correct |
15 |
Correct |
33 ms |
19728 KB |
Output is correct |
16 |
Correct |
30 ms |
19472 KB |
Output is correct |
17 |
Correct |
7 ms |
11748 KB |
Output is correct |
18 |
Correct |
7 ms |
11496 KB |
Output is correct |
19 |
Correct |
6 ms |
11612 KB |
Output is correct |
20 |
Correct |
6 ms |
11496 KB |
Output is correct |
21 |
Correct |
6 ms |
11488 KB |
Output is correct |
22 |
Correct |
7 ms |
11488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
10080 KB |
Output is correct |
2 |
Correct |
5 ms |
10076 KB |
Output is correct |
3 |
Correct |
5 ms |
10072 KB |
Output is correct |
4 |
Correct |
4 ms |
10076 KB |
Output is correct |
5 |
Correct |
4 ms |
10076 KB |
Output is correct |
6 |
Correct |
4 ms |
10076 KB |
Output is correct |
7 |
Correct |
5 ms |
10076 KB |
Output is correct |
8 |
Correct |
4 ms |
10136 KB |
Output is correct |
9 |
Correct |
4 ms |
10072 KB |
Output is correct |
10 |
Correct |
6 ms |
9916 KB |
Output is correct |
11 |
Correct |
5 ms |
9884 KB |
Output is correct |
12 |
Correct |
4 ms |
10072 KB |
Output is correct |
13 |
Correct |
4 ms |
10076 KB |
Output is correct |
14 |
Correct |
4 ms |
10076 KB |
Output is correct |
15 |
Correct |
5 ms |
10072 KB |
Output is correct |
16 |
Correct |
4 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9820 KB |
Output is correct |
18 |
Correct |
4 ms |
9820 KB |
Output is correct |
19 |
Correct |
4 ms |
9876 KB |
Output is correct |
20 |
Correct |
4 ms |
9816 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
81 ms |
32132 KB |
Output is correct |
2 |
Correct |
70 ms |
32004 KB |
Output is correct |
3 |
Correct |
74 ms |
32008 KB |
Output is correct |
4 |
Correct |
67 ms |
32116 KB |
Output is correct |
5 |
Correct |
74 ms |
32284 KB |
Output is correct |
6 |
Correct |
116 ms |
44512 KB |
Output is correct |
7 |
Correct |
85 ms |
38460 KB |
Output is correct |
8 |
Correct |
83 ms |
37352 KB |
Output is correct |
9 |
Correct |
84 ms |
34440 KB |
Output is correct |
10 |
Correct |
67 ms |
32004 KB |
Output is correct |
11 |
Correct |
66 ms |
32000 KB |
Output is correct |
12 |
Correct |
72 ms |
32156 KB |
Output is correct |
13 |
Correct |
69 ms |
31996 KB |
Output is correct |
14 |
Correct |
71 ms |
31488 KB |
Output is correct |
15 |
Correct |
53 ms |
26624 KB |
Output is correct |
16 |
Correct |
33 ms |
22148 KB |
Output is correct |
17 |
Correct |
44 ms |
28224 KB |
Output is correct |
18 |
Correct |
46 ms |
28324 KB |
Output is correct |
19 |
Correct |
45 ms |
28276 KB |
Output is correct |
20 |
Correct |
48 ms |
28164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
10076 KB |
Output is correct |
2 |
Correct |
4 ms |
10076 KB |
Output is correct |
3 |
Correct |
5 ms |
10076 KB |
Output is correct |
4 |
Correct |
4 ms |
10076 KB |
Output is correct |
5 |
Correct |
4 ms |
9820 KB |
Output is correct |
6 |
Correct |
4 ms |
9816 KB |
Output is correct |
7 |
Correct |
4 ms |
9772 KB |
Output is correct |
8 |
Correct |
4 ms |
9820 KB |
Output is correct |
9 |
Correct |
5 ms |
9820 KB |
Output is correct |
10 |
Correct |
4 ms |
9820 KB |
Output is correct |
11 |
Correct |
4 ms |
9820 KB |
Output is correct |
12 |
Correct |
7 ms |
10068 KB |
Output is correct |
13 |
Correct |
5 ms |
10128 KB |
Output is correct |
14 |
Correct |
6 ms |
10072 KB |
Output is correct |
15 |
Correct |
7 ms |
10144 KB |
Output is correct |
16 |
Correct |
5 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9820 KB |
Output is correct |
18 |
Correct |
4 ms |
9820 KB |
Output is correct |
19 |
Correct |
4 ms |
9820 KB |
Output is correct |
20 |
Correct |
5 ms |
9816 KB |
Output is correct |
21 |
Correct |
5 ms |
10076 KB |
Output is correct |
22 |
Correct |
5 ms |
10076 KB |
Output is correct |
23 |
Correct |
5 ms |
9820 KB |
Output is correct |
24 |
Correct |
4 ms |
9820 KB |
Output is correct |
25 |
Correct |
4 ms |
9820 KB |
Output is correct |
26 |
Correct |
5 ms |
9820 KB |
Output is correct |
27 |
Correct |
4 ms |
9820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
32008 KB |
Output is correct |
2 |
Correct |
82 ms |
31748 KB |
Output is correct |
3 |
Correct |
73 ms |
31492 KB |
Output is correct |
4 |
Correct |
60 ms |
25092 KB |
Output is correct |
5 |
Correct |
53 ms |
21300 KB |
Output is correct |
6 |
Correct |
45 ms |
19728 KB |
Output is correct |
7 |
Correct |
41 ms |
19724 KB |
Output is correct |
8 |
Correct |
49 ms |
17916 KB |
Output is correct |
9 |
Correct |
43 ms |
17804 KB |
Output is correct |
10 |
Correct |
35 ms |
17296 KB |
Output is correct |
11 |
Correct |
42 ms |
16720 KB |
Output is correct |
12 |
Correct |
31 ms |
16720 KB |
Output is correct |
13 |
Correct |
32 ms |
16464 KB |
Output is correct |
14 |
Correct |
43 ms |
19928 KB |
Output is correct |
15 |
Correct |
79 ms |
36752 KB |
Output is correct |
16 |
Correct |
83 ms |
35072 KB |
Output is correct |
17 |
Correct |
76 ms |
35544 KB |
Output is correct |
18 |
Correct |
72 ms |
30724 KB |
Output is correct |
19 |
Correct |
70 ms |
25088 KB |
Output is correct |
20 |
Correct |
60 ms |
25088 KB |
Output is correct |
21 |
Correct |
61 ms |
25208 KB |
Output is correct |
22 |
Correct |
54 ms |
23560 KB |
Output is correct |
23 |
Correct |
43 ms |
20996 KB |
Output is correct |
24 |
Correct |
58 ms |
27404 KB |
Output is correct |
25 |
Correct |
63 ms |
27540 KB |
Output is correct |
26 |
Correct |
57 ms |
25984 KB |
Output is correct |
27 |
Correct |
60 ms |
25860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9816 KB |
Output is correct |
2 |
Correct |
4 ms |
9820 KB |
Output is correct |
3 |
Correct |
4 ms |
9816 KB |
Output is correct |
4 |
Correct |
5 ms |
9820 KB |
Output is correct |
5 |
Correct |
4 ms |
9876 KB |
Output is correct |
6 |
Correct |
6 ms |
9820 KB |
Output is correct |
7 |
Correct |
5 ms |
9820 KB |
Output is correct |
8 |
Correct |
4 ms |
10072 KB |
Output is correct |
9 |
Correct |
5 ms |
10072 KB |
Output is correct |
10 |
Correct |
4 ms |
9620 KB |
Output is correct |
11 |
Correct |
5 ms |
9820 KB |
Output is correct |
12 |
Correct |
5 ms |
9872 KB |
Output is correct |
13 |
Correct |
4 ms |
9820 KB |
Output is correct |
14 |
Correct |
4 ms |
9816 KB |
Output is correct |
15 |
Correct |
4 ms |
9820 KB |
Output is correct |
16 |
Correct |
5 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9980 KB |
Output is correct |
18 |
Correct |
5 ms |
9820 KB |
Output is correct |
19 |
Correct |
6 ms |
9776 KB |
Output is correct |
20 |
Correct |
4 ms |
9820 KB |
Output is correct |
21 |
Correct |
4 ms |
9820 KB |
Output is correct |
22 |
Correct |
4 ms |
9816 KB |
Output is correct |
23 |
Correct |
5 ms |
9820 KB |
Output is correct |
24 |
Correct |
4 ms |
9820 KB |
Output is correct |
25 |
Correct |
5 ms |
9680 KB |
Output is correct |
26 |
Correct |
4 ms |
9820 KB |
Output is correct |
27 |
Correct |
4 ms |
9820 KB |
Output is correct |
28 |
Correct |
5 ms |
9820 KB |
Output is correct |
29 |
Correct |
4 ms |
9820 KB |
Output is correct |
30 |
Correct |
5 ms |
9820 KB |
Output is correct |
31 |
Correct |
5 ms |
9876 KB |
Output is correct |
32 |
Correct |
4 ms |
9792 KB |
Output is correct |
33 |
Correct |
4 ms |
9820 KB |
Output is correct |
34 |
Correct |
5 ms |
9820 KB |
Output is correct |
35 |
Correct |
4 ms |
9852 KB |
Output is correct |
36 |
Correct |
4 ms |
9816 KB |
Output is correct |
37 |
Correct |
4 ms |
9820 KB |
Output is correct |
38 |
Correct |
5 ms |
9820 KB |
Output is correct |
39 |
Correct |
4 ms |
9820 KB |
Output is correct |
40 |
Correct |
4 ms |
9820 KB |
Output is correct |
41 |
Correct |
4 ms |
9820 KB |
Output is correct |
42 |
Correct |
4 ms |
9820 KB |
Output is correct |
43 |
Correct |
5 ms |
9820 KB |
Output is correct |
44 |
Correct |
4 ms |
9880 KB |
Output is correct |
45 |
Correct |
4 ms |
9872 KB |
Output is correct |
46 |
Correct |
4 ms |
9820 KB |
Output is correct |
47 |
Correct |
4 ms |
9820 KB |
Output is correct |
48 |
Correct |
5 ms |
9704 KB |
Output is correct |
49 |
Correct |
5 ms |
9820 KB |
Output is correct |
50 |
Correct |
5 ms |
9820 KB |
Output is correct |
51 |
Correct |
4 ms |
9820 KB |
Output is correct |
52 |
Correct |
5 ms |
9820 KB |
Output is correct |
53 |
Correct |
5 ms |
9820 KB |
Output is correct |
54 |
Correct |
4 ms |
9816 KB |
Output is correct |
55 |
Correct |
4 ms |
9820 KB |
Output is correct |
56 |
Correct |
4 ms |
9820 KB |
Output is correct |
57 |
Correct |
4 ms |
9820 KB |
Output is correct |
58 |
Correct |
5 ms |
10076 KB |
Output is correct |
59 |
Correct |
4 ms |
9820 KB |
Output is correct |
60 |
Correct |
4 ms |
9820 KB |
Output is correct |
61 |
Correct |
4 ms |
9820 KB |
Output is correct |
62 |
Correct |
5 ms |
9820 KB |
Output is correct |
63 |
Correct |
4 ms |
9872 KB |
Output is correct |
64 |
Correct |
4 ms |
9656 KB |
Output is correct |
65 |
Correct |
4 ms |
9704 KB |
Output is correct |
66 |
Correct |
4 ms |
9820 KB |
Output is correct |
67 |
Correct |
4 ms |
9820 KB |
Output is correct |
68 |
Correct |
4 ms |
9820 KB |
Output is correct |
69 |
Correct |
4 ms |
9820 KB |
Output is correct |
70 |
Correct |
4 ms |
9816 KB |
Output is correct |
71 |
Correct |
5 ms |
9820 KB |
Output is correct |
72 |
Correct |
5 ms |
9820 KB |
Output is correct |
73 |
Correct |
8 ms |
9820 KB |
Output is correct |
74 |
Correct |
5 ms |
9880 KB |
Output is correct |
75 |
Correct |
5 ms |
9820 KB |
Output is correct |
76 |
Correct |
4 ms |
9820 KB |
Output is correct |
77 |
Correct |
4 ms |
9820 KB |
Output is correct |
78 |
Correct |
5 ms |
9820 KB |
Output is correct |
79 |
Correct |
4 ms |
9820 KB |
Output is correct |
80 |
Correct |
4 ms |
9872 KB |
Output is correct |
81 |
Correct |
4 ms |
9820 KB |
Output is correct |
82 |
Correct |
5 ms |
9820 KB |
Output is correct |
83 |
Correct |
4 ms |
9820 KB |
Output is correct |
84 |
Correct |
5 ms |
10016 KB |
Output is correct |
85 |
Correct |
6 ms |
9820 KB |
Output is correct |
86 |
Correct |
5 ms |
10004 KB |
Output is correct |
87 |
Correct |
5 ms |
9820 KB |
Output is correct |
88 |
Correct |
4 ms |
9820 KB |
Output is correct |
89 |
Correct |
5 ms |
9832 KB |
Output is correct |
90 |
Correct |
4 ms |
9820 KB |
Output is correct |
91 |
Correct |
5 ms |
9816 KB |
Output is correct |
92 |
Correct |
4 ms |
9820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9816 KB |
Output is correct |
2 |
Correct |
4 ms |
9820 KB |
Output is correct |
3 |
Correct |
4 ms |
9816 KB |
Output is correct |
4 |
Correct |
5 ms |
9820 KB |
Output is correct |
5 |
Correct |
4 ms |
9876 KB |
Output is correct |
6 |
Correct |
6 ms |
9820 KB |
Output is correct |
7 |
Correct |
5 ms |
9820 KB |
Output is correct |
8 |
Correct |
4 ms |
10072 KB |
Output is correct |
9 |
Correct |
5 ms |
10072 KB |
Output is correct |
10 |
Correct |
4 ms |
9620 KB |
Output is correct |
11 |
Correct |
5 ms |
9820 KB |
Output is correct |
12 |
Correct |
5 ms |
9872 KB |
Output is correct |
13 |
Correct |
4 ms |
9820 KB |
Output is correct |
14 |
Correct |
4 ms |
9816 KB |
Output is correct |
15 |
Correct |
4 ms |
9820 KB |
Output is correct |
16 |
Correct |
5 ms |
9820 KB |
Output is correct |
17 |
Correct |
4 ms |
9980 KB |
Output is correct |
18 |
Correct |
5 ms |
9820 KB |
Output is correct |
19 |
Correct |
6 ms |
9776 KB |
Output is correct |
20 |
Correct |
4 ms |
9820 KB |
Output is correct |
21 |
Correct |
4 ms |
9820 KB |
Output is correct |
22 |
Correct |
4 ms |
9816 KB |
Output is correct |
23 |
Correct |
5 ms |
9820 KB |
Output is correct |
24 |
Correct |
4 ms |
9820 KB |
Output is correct |
25 |
Correct |
5 ms |
9680 KB |
Output is correct |
26 |
Correct |
4 ms |
9820 KB |
Output is correct |
27 |
Correct |
4 ms |
9820 KB |
Output is correct |
28 |
Correct |
5 ms |
9820 KB |
Output is correct |
29 |
Correct |
4 ms |
9820 KB |
Output is correct |
30 |
Correct |
5 ms |
9820 KB |
Output is correct |
31 |
Correct |
5 ms |
9876 KB |
Output is correct |
32 |
Correct |
4 ms |
9792 KB |
Output is correct |
33 |
Correct |
4 ms |
9820 KB |
Output is correct |
34 |
Correct |
5 ms |
9820 KB |
Output is correct |
35 |
Correct |
4 ms |
9852 KB |
Output is correct |
36 |
Correct |
4 ms |
9816 KB |
Output is correct |
37 |
Correct |
4 ms |
9820 KB |
Output is correct |
38 |
Correct |
5 ms |
9820 KB |
Output is correct |
39 |
Correct |
4 ms |
9820 KB |
Output is correct |
40 |
Correct |
4 ms |
9820 KB |
Output is correct |
41 |
Correct |
4 ms |
9820 KB |
Output is correct |
42 |
Correct |
4 ms |
9820 KB |
Output is correct |
43 |
Correct |
5 ms |
9820 KB |
Output is correct |
44 |
Correct |
4 ms |
9880 KB |
Output is correct |
45 |
Correct |
4 ms |
9872 KB |
Output is correct |
46 |
Correct |
4 ms |
9820 KB |
Output is correct |
47 |
Correct |
4 ms |
9820 KB |
Output is correct |
48 |
Correct |
5 ms |
9704 KB |
Output is correct |
49 |
Correct |
5 ms |
9820 KB |
Output is correct |
50 |
Correct |
5 ms |
9820 KB |
Output is correct |
51 |
Correct |
4 ms |
9820 KB |
Output is correct |
52 |
Correct |
5 ms |
9820 KB |
Output is correct |
53 |
Correct |
5 ms |
9820 KB |
Output is correct |
54 |
Correct |
4 ms |
9816 KB |
Output is correct |
55 |
Correct |
4 ms |
9820 KB |
Output is correct |
56 |
Correct |
4 ms |
9820 KB |
Output is correct |
57 |
Correct |
4 ms |
9820 KB |
Output is correct |
58 |
Correct |
5 ms |
10076 KB |
Output is correct |
59 |
Correct |
4 ms |
9820 KB |
Output is correct |
60 |
Correct |
4 ms |
9820 KB |
Output is correct |
61 |
Correct |
4 ms |
9820 KB |
Output is correct |
62 |
Correct |
5 ms |
9820 KB |
Output is correct |
63 |
Correct |
4 ms |
9872 KB |
Output is correct |
64 |
Correct |
4 ms |
9656 KB |
Output is correct |
65 |
Correct |
4 ms |
9704 KB |
Output is correct |
66 |
Correct |
47 ms |
30700 KB |
Output is correct |
67 |
Correct |
41 ms |
30788 KB |
Output is correct |
68 |
Correct |
62 ms |
32844 KB |
Output is correct |
69 |
Correct |
50 ms |
30984 KB |
Output is correct |
70 |
Correct |
56 ms |
27788 KB |
Output is correct |
71 |
Correct |
68 ms |
31820 KB |
Output is correct |
72 |
Correct |
63 ms |
29340 KB |
Output is correct |
73 |
Correct |
65 ms |
30188 KB |
Output is correct |
74 |
Correct |
61 ms |
27460 KB |
Output is correct |
75 |
Correct |
58 ms |
26880 KB |
Output is correct |
76 |
Correct |
43 ms |
23104 KB |
Output is correct |
77 |
Correct |
45 ms |
23008 KB |
Output is correct |
78 |
Correct |
39 ms |
22788 KB |
Output is correct |
79 |
Correct |
38 ms |
22800 KB |
Output is correct |
80 |
Correct |
33 ms |
19728 KB |
Output is correct |
81 |
Correct |
30 ms |
19472 KB |
Output is correct |
82 |
Correct |
7 ms |
11748 KB |
Output is correct |
83 |
Correct |
7 ms |
11496 KB |
Output is correct |
84 |
Correct |
6 ms |
11612 KB |
Output is correct |
85 |
Correct |
6 ms |
11496 KB |
Output is correct |
86 |
Correct |
6 ms |
11488 KB |
Output is correct |
87 |
Correct |
7 ms |
11488 KB |
Output is correct |
88 |
Correct |
5 ms |
10080 KB |
Output is correct |
89 |
Correct |
5 ms |
10076 KB |
Output is correct |
90 |
Correct |
5 ms |
10072 KB |
Output is correct |
91 |
Correct |
4 ms |
10076 KB |
Output is correct |
92 |
Correct |
4 ms |
10076 KB |
Output is correct |
93 |
Correct |
4 ms |
10076 KB |
Output is correct |
94 |
Correct |
5 ms |
10076 KB |
Output is correct |
95 |
Correct |
4 ms |
10136 KB |
Output is correct |
96 |
Correct |
4 ms |
10072 KB |
Output is correct |
97 |
Correct |
6 ms |
9916 KB |
Output is correct |
98 |
Correct |
5 ms |
9884 KB |
Output is correct |
99 |
Correct |
4 ms |
10072 KB |
Output is correct |
100 |
Correct |
4 ms |
10076 KB |
Output is correct |
101 |
Correct |
4 ms |
10076 KB |
Output is correct |
102 |
Correct |
5 ms |
10072 KB |
Output is correct |
103 |
Correct |
4 ms |
9820 KB |
Output is correct |
104 |
Correct |
4 ms |
9820 KB |
Output is correct |
105 |
Correct |
4 ms |
9820 KB |
Output is correct |
106 |
Correct |
4 ms |
9876 KB |
Output is correct |
107 |
Correct |
4 ms |
9816 KB |
Output is correct |
108 |
Correct |
81 ms |
32132 KB |
Output is correct |
109 |
Correct |
70 ms |
32004 KB |
Output is correct |
110 |
Correct |
74 ms |
32008 KB |
Output is correct |
111 |
Correct |
67 ms |
32116 KB |
Output is correct |
112 |
Correct |
74 ms |
32284 KB |
Output is correct |
113 |
Correct |
116 ms |
44512 KB |
Output is correct |
114 |
Correct |
85 ms |
38460 KB |
Output is correct |
115 |
Correct |
83 ms |
37352 KB |
Output is correct |
116 |
Correct |
84 ms |
34440 KB |
Output is correct |
117 |
Correct |
67 ms |
32004 KB |
Output is correct |
118 |
Correct |
66 ms |
32000 KB |
Output is correct |
119 |
Correct |
72 ms |
32156 KB |
Output is correct |
120 |
Correct |
69 ms |
31996 KB |
Output is correct |
121 |
Correct |
71 ms |
31488 KB |
Output is correct |
122 |
Correct |
53 ms |
26624 KB |
Output is correct |
123 |
Correct |
33 ms |
22148 KB |
Output is correct |
124 |
Correct |
44 ms |
28224 KB |
Output is correct |
125 |
Correct |
46 ms |
28324 KB |
Output is correct |
126 |
Correct |
45 ms |
28276 KB |
Output is correct |
127 |
Correct |
48 ms |
28164 KB |
Output is correct |
128 |
Correct |
5 ms |
10076 KB |
Output is correct |
129 |
Correct |
4 ms |
10076 KB |
Output is correct |
130 |
Correct |
5 ms |
10076 KB |
Output is correct |
131 |
Correct |
4 ms |
10076 KB |
Output is correct |
132 |
Correct |
4 ms |
9820 KB |
Output is correct |
133 |
Correct |
4 ms |
9816 KB |
Output is correct |
134 |
Correct |
4 ms |
9772 KB |
Output is correct |
135 |
Correct |
4 ms |
9820 KB |
Output is correct |
136 |
Correct |
5 ms |
9820 KB |
Output is correct |
137 |
Correct |
4 ms |
9820 KB |
Output is correct |
138 |
Correct |
4 ms |
9820 KB |
Output is correct |
139 |
Correct |
7 ms |
10068 KB |
Output is correct |
140 |
Correct |
5 ms |
10128 KB |
Output is correct |
141 |
Correct |
6 ms |
10072 KB |
Output is correct |
142 |
Correct |
7 ms |
10144 KB |
Output is correct |
143 |
Correct |
5 ms |
9820 KB |
Output is correct |
144 |
Correct |
4 ms |
9820 KB |
Output is correct |
145 |
Correct |
4 ms |
9820 KB |
Output is correct |
146 |
Correct |
4 ms |
9820 KB |
Output is correct |
147 |
Correct |
5 ms |
9816 KB |
Output is correct |
148 |
Correct |
5 ms |
10076 KB |
Output is correct |
149 |
Correct |
5 ms |
10076 KB |
Output is correct |
150 |
Correct |
5 ms |
9820 KB |
Output is correct |
151 |
Correct |
4 ms |
9820 KB |
Output is correct |
152 |
Correct |
4 ms |
9820 KB |
Output is correct |
153 |
Correct |
5 ms |
9820 KB |
Output is correct |
154 |
Correct |
4 ms |
9820 KB |
Output is correct |
155 |
Correct |
68 ms |
32008 KB |
Output is correct |
156 |
Correct |
82 ms |
31748 KB |
Output is correct |
157 |
Correct |
73 ms |
31492 KB |
Output is correct |
158 |
Correct |
60 ms |
25092 KB |
Output is correct |
159 |
Correct |
53 ms |
21300 KB |
Output is correct |
160 |
Correct |
45 ms |
19728 KB |
Output is correct |
161 |
Correct |
41 ms |
19724 KB |
Output is correct |
162 |
Correct |
49 ms |
17916 KB |
Output is correct |
163 |
Correct |
43 ms |
17804 KB |
Output is correct |
164 |
Correct |
35 ms |
17296 KB |
Output is correct |
165 |
Correct |
42 ms |
16720 KB |
Output is correct |
166 |
Correct |
31 ms |
16720 KB |
Output is correct |
167 |
Correct |
32 ms |
16464 KB |
Output is correct |
168 |
Correct |
43 ms |
19928 KB |
Output is correct |
169 |
Correct |
79 ms |
36752 KB |
Output is correct |
170 |
Correct |
83 ms |
35072 KB |
Output is correct |
171 |
Correct |
76 ms |
35544 KB |
Output is correct |
172 |
Correct |
72 ms |
30724 KB |
Output is correct |
173 |
Correct |
70 ms |
25088 KB |
Output is correct |
174 |
Correct |
60 ms |
25088 KB |
Output is correct |
175 |
Correct |
61 ms |
25208 KB |
Output is correct |
176 |
Correct |
54 ms |
23560 KB |
Output is correct |
177 |
Correct |
43 ms |
20996 KB |
Output is correct |
178 |
Correct |
58 ms |
27404 KB |
Output is correct |
179 |
Correct |
63 ms |
27540 KB |
Output is correct |
180 |
Correct |
57 ms |
25984 KB |
Output is correct |
181 |
Correct |
60 ms |
25860 KB |
Output is correct |
182 |
Correct |
4 ms |
9820 KB |
Output is correct |
183 |
Correct |
4 ms |
9820 KB |
Output is correct |
184 |
Correct |
4 ms |
9820 KB |
Output is correct |
185 |
Correct |
4 ms |
9820 KB |
Output is correct |
186 |
Correct |
4 ms |
9816 KB |
Output is correct |
187 |
Correct |
5 ms |
9820 KB |
Output is correct |
188 |
Correct |
5 ms |
9820 KB |
Output is correct |
189 |
Correct |
8 ms |
9820 KB |
Output is correct |
190 |
Correct |
5 ms |
9880 KB |
Output is correct |
191 |
Correct |
5 ms |
9820 KB |
Output is correct |
192 |
Correct |
4 ms |
9820 KB |
Output is correct |
193 |
Correct |
4 ms |
9820 KB |
Output is correct |
194 |
Correct |
5 ms |
9820 KB |
Output is correct |
195 |
Correct |
4 ms |
9820 KB |
Output is correct |
196 |
Correct |
4 ms |
9872 KB |
Output is correct |
197 |
Correct |
4 ms |
9820 KB |
Output is correct |
198 |
Correct |
5 ms |
9820 KB |
Output is correct |
199 |
Correct |
4 ms |
9820 KB |
Output is correct |
200 |
Correct |
5 ms |
10016 KB |
Output is correct |
201 |
Correct |
6 ms |
9820 KB |
Output is correct |
202 |
Correct |
5 ms |
10004 KB |
Output is correct |
203 |
Correct |
5 ms |
9820 KB |
Output is correct |
204 |
Correct |
4 ms |
9820 KB |
Output is correct |
205 |
Correct |
5 ms |
9832 KB |
Output is correct |
206 |
Correct |
4 ms |
9820 KB |
Output is correct |
207 |
Correct |
5 ms |
9816 KB |
Output is correct |
208 |
Correct |
4 ms |
9820 KB |
Output is correct |
209 |
Correct |
6 ms |
11484 KB |
Output is correct |
210 |
Correct |
38 ms |
22028 KB |
Output is correct |
211 |
Correct |
56 ms |
24916 KB |
Output is correct |
212 |
Correct |
57 ms |
27280 KB |
Output is correct |
213 |
Correct |
63 ms |
28104 KB |
Output is correct |
214 |
Correct |
43 ms |
21264 KB |
Output is correct |
215 |
Correct |
35 ms |
19984 KB |
Output is correct |
216 |
Correct |
62 ms |
25812 KB |
Output is correct |
217 |
Correct |
54 ms |
22020 KB |
Output is correct |
218 |
Correct |
42 ms |
17912 KB |
Output is correct |
219 |
Correct |
38 ms |
17028 KB |
Output is correct |
220 |
Correct |
50 ms |
16668 KB |
Output is correct |
221 |
Correct |
31 ms |
16212 KB |
Output is correct |
222 |
Correct |
39 ms |
18196 KB |
Output is correct |
223 |
Correct |
68 ms |
27648 KB |
Output is correct |
224 |
Correct |
61 ms |
26628 KB |
Output is correct |
225 |
Correct |
59 ms |
21020 KB |
Output is correct |
226 |
Correct |
93 ms |
20996 KB |
Output is correct |
227 |
Correct |
53 ms |
20972 KB |
Output is correct |
228 |
Correct |
50 ms |
20152 KB |
Output is correct |
229 |
Correct |
46 ms |
18680 KB |
Output is correct |
230 |
Correct |
54 ms |
21508 KB |
Output is correct |
231 |
Correct |
60 ms |
21716 KB |
Output is correct |