#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
constexpr ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
template<class T> bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
constexpr int dy[4]={-1,0,1,0};
constexpr int dx[4]={0,-1,0,1};
template<typename T>
struct SegmentTree{
private:
int n, N;
vector<T> node;
function<T(T, T)> F;
T E;
public:
void init(int _n, function<T(T, T)> f, T e){
F = f;
E = e;
n = _n;
N = 1;
while(N < n) N = (N<<1);
node.assign(2*N-1, e);
}
void init(vector<T> v, function<T(T, T)> f, T e){
F = f;
E = e;
n = v.size();
N = 1;
while(N < n) N = (N<<1);
node.assign(2*N-1, e);
for(int i=0; i<n; i++) node[N-1+i] = v[i];
for(int i=N-2; i>=0; i--) node[i] = F(node[(i<<1)+1], node[(i<<1)+2]);
}
T& operator [](int a){
return node[N-1+a];
}
void update(int a, T x){
a += N-1;
node[a] = x;
while(a > 0){
a = (a-1)>>1;
node[a] = F(node[(a<<1)+1], node[(a<<1)+2]);
}
}
T query(int a, int b, int k=0, int l=0, int r=-1){
if(r == -1) r = N;
if(b <= l || r <= a) return E;
if(a <= l && r <= b) return node[k];
return F(query(a, b, (k<<1)+1, l, (l+r)>>1), query(a, b, (k<<1)+2, (l+r)>>1, r));
}
int find_right(function<bool(T)> g, int a){
if(!g(E)) return -1;
T t = E;
return min(find_right(g, a, 0, 0, N, t), n);
}
int find_right(function<bool(T)> g, int a, int k, int l, int r, T &t){
if(r-l == 1){
t = F(t, node[k]);
return g(t) ? r : a;
}
int m = (l + r) >> 1;
if(m <= a) return find_right(g, a, (k<<1)+2, m, r, t);
if(a <= l && g(F(t, node[k]))){
t = F(t, node[k]);
return r;
}
int L = find_right(g, a, (k<<1)+1, l, m, t);
if(L < m) return L;
int R = find_right(g, a, (k<<1)+2, m, r, t);
return max(L, R);
}
int find_left(function<bool(T)> g, int b){
if(!g(E)) return n + 1;
T t = E;
return find_left(g, b, 0, 0, N, t);
}
int find_left(function<bool(T)> g, int b, int k, int l, int r, T t){
if(r-l == 1){
t = F(node[k], t);
return g(t) ? l : b;
}
int m = (l + r) >> 1;
if(b <= m) return find_left(g, b, (k<<1)+1, l, m, t);
if(r <= b && g(F(node[k], t))){
t = F(node[k], t);
return l;
}
int R = find_left(g, b, (k<<1)+2, m, r, t);
if(m < R) return R;
int L = find_left(g, b, (k<<1)+1, l, m, t);
return min(L, R);
}
};
int N;
int C[100000];
int A[100000], B[100000];
vector<int> z;
int par[100000] ={-1};
vector<int> chi[100000];
int s[100000] ={};
int siz(int v){
if(s[v] != 0) return s[v];
s[v] = 1;
for(int i=0; i<chi[v].size(); i++) s[v] += siz(chi[v][i]);
return s[v];
}
int d[100000] ={};
int depth(int v){
if(d[v] != 0) return d[v];
if(par[v] == -1) return 0;
return d[v] = 1 + depth(par[v]);
}
vector<int> hld;
int pre[100000];
int top[100000];
void HLD(int v, int a){
pre[v] = hld.size();
hld.pb(v);
top[v] = a;
if(chi[v].size() == 0) return;
int M = 0;
int idx = -1;
for(int i=0; i<chi[v].size(); i++){
if(chmax(M, siz(chi[v][i]))) idx = i;
}
HLD(chi[v][idx], a);
for(int i=0; i<chi[v].size(); i++){
if(i != idx) HLD(chi[v][i], chi[v][i]);
}
}
vector<pair<int, int>> query(int v){ // [,]
vector<pair<int, int>> ret;
while(v != -1){
ret.pb({pre[top[v]], pre[v]});
v = par[top[v]];
}
reverse(all(ret));
return ret;
}
struct range{
int l, r, a;
};
stack<range> st[100000];
SegmentTree<ll> segtree;
signed main(){
scanf("%d", &N);
rep(i, N){
scanf("%d", C+i);
z.pb(C[i]);
}
sort(all(z));
rep(i, N) C[i] = lower_bound(all(z), C[i]) - z.begin();
rep(i, N-1){
scanf("%d%d", A+i, B+i);
A[i]--; B[i]--;
par[B[i]] = A[i];
chi[A[i]].pb(B[i]);
}
HLD(0, 0);
st[0].push({0,0,C[0]});
segtree.init(N, [](ll a, ll b){ return a+b; }, 0);
rep(i, N-1){
ll ans = 0;
auto v = query(B[i]);
vector<int> memo;
rep(j, v.size()){
while(st[v[j].first].size() > 0 && st[v[j].first].top().l <= v[j].second){ // O(N log N)
range r = st[v[j].first].top();
st[v[j].first].pop();
if(v[j].second < r.r){
st[v[j].first].push({v[j].second+1, r.r, r.a});
r.r = v[j].second;
}
ans += segtree.query(r.a+1, N) * (ll)(r.r - r.l + 1);
segtree.update(r.a, segtree[r.a] + r.r - r.l + 1);
memo.pb(r.a);
}
st[v[j].first].push({v[j].first, v[j].second, C[B[i]]});
}
printf("%lld\n", ans);
rep(j, memo.size()) segtree.update(memo[j], 0);
}
}
Compilation message
construction.cpp: In function 'int siz(int)':
construction.cpp:120:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
120 | for(int i=0; i<chi[v].size(); i++) s[v] += siz(chi[v][i]);
| ~^~~~~~~~~~~~~~
construction.cpp: In function 'void HLD(int, int)':
construction.cpp:142:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
142 | for(int i=0; i<chi[v].size(); i++){
| ~^~~~~~~~~~~~~~
construction.cpp:146:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
146 | for(int i=0; i<chi[v].size(); i++){
| ~^~~~~~~~~~~~~~
construction.cpp: In function 'int main()':
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:171:5: note: in expansion of macro 'rep'
171 | rep(i, N){
| ^~~
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:176:5: note: in expansion of macro 'rep'
176 | rep(i, N) C[i] = lower_bound(all(z), C[i]) - z.begin();
| ^~~
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:177:5: note: in expansion of macro 'rep'
177 | rep(i, N-1){
| ^~~
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:188:5: note: in expansion of macro 'rep'
188 | rep(i, N-1){
| ^~~
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:192:9: note: in expansion of macro 'rep'
192 | rep(j, v.size()){
| ^~~
construction.cpp:15:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ~~~^~~~
construction.cpp:192:9: note: in expansion of macro 'rep'
192 | rep(j, v.size()){
| ^~~
construction.cpp:15:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ^
construction.cpp:207:9: note: in expansion of macro 'rep'
207 | rep(j, memo.size()) segtree.update(memo[j], 0);
| ^~~
construction.cpp:15:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
15 | #define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
| ~~~^~~~
construction.cpp:207:9: note: in expansion of macro 'rep'
207 | rep(j, memo.size()) segtree.update(memo[j], 0);
| ^~~
construction.cpp:170:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
170 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
construction.cpp:172:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
172 | scanf("%d", C+i);
| ~~~~~^~~~~~~~~~~
construction.cpp:178:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
178 | scanf("%d%d", A+i, B+i);
| ~~~~~^~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
68424 KB |
Output is correct |
2 |
Correct |
55 ms |
68420 KB |
Output is correct |
3 |
Correct |
51 ms |
68424 KB |
Output is correct |
4 |
Correct |
47 ms |
68456 KB |
Output is correct |
5 |
Correct |
53 ms |
68464 KB |
Output is correct |
6 |
Correct |
47 ms |
68464 KB |
Output is correct |
7 |
Correct |
57 ms |
68368 KB |
Output is correct |
8 |
Correct |
44 ms |
68396 KB |
Output is correct |
9 |
Correct |
49 ms |
68436 KB |
Output is correct |
10 |
Correct |
47 ms |
68508 KB |
Output is correct |
11 |
Correct |
47 ms |
68480 KB |
Output is correct |
12 |
Correct |
48 ms |
68400 KB |
Output is correct |
13 |
Correct |
48 ms |
68464 KB |
Output is correct |
14 |
Correct |
46 ms |
68372 KB |
Output is correct |
15 |
Correct |
48 ms |
68516 KB |
Output is correct |
16 |
Correct |
53 ms |
68460 KB |
Output is correct |
17 |
Correct |
71 ms |
68424 KB |
Output is correct |
18 |
Correct |
46 ms |
68456 KB |
Output is correct |
19 |
Correct |
45 ms |
68372 KB |
Output is correct |
20 |
Correct |
45 ms |
68480 KB |
Output is correct |
21 |
Correct |
44 ms |
68428 KB |
Output is correct |
22 |
Correct |
46 ms |
68544 KB |
Output is correct |
23 |
Correct |
46 ms |
68420 KB |
Output is correct |
24 |
Correct |
46 ms |
68380 KB |
Output is correct |
25 |
Correct |
45 ms |
68464 KB |
Output is correct |
26 |
Correct |
47 ms |
68424 KB |
Output is correct |
27 |
Correct |
46 ms |
68476 KB |
Output is correct |
28 |
Correct |
49 ms |
68420 KB |
Output is correct |
29 |
Correct |
53 ms |
68428 KB |
Output is correct |
30 |
Correct |
51 ms |
68480 KB |
Output is correct |
31 |
Correct |
48 ms |
68480 KB |
Output is correct |
32 |
Correct |
52 ms |
68432 KB |
Output is correct |
33 |
Correct |
48 ms |
68428 KB |
Output is correct |
34 |
Correct |
57 ms |
68472 KB |
Output is correct |
35 |
Correct |
48 ms |
68420 KB |
Output is correct |
36 |
Correct |
47 ms |
68388 KB |
Output is correct |
37 |
Correct |
46 ms |
68384 KB |
Output is correct |
38 |
Correct |
46 ms |
68404 KB |
Output is correct |
39 |
Correct |
61 ms |
68408 KB |
Output is correct |
40 |
Correct |
51 ms |
68480 KB |
Output is correct |
41 |
Correct |
46 ms |
68376 KB |
Output is correct |
42 |
Correct |
46 ms |
68412 KB |
Output is correct |
43 |
Correct |
46 ms |
68392 KB |
Output is correct |
44 |
Correct |
53 ms |
68420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
68424 KB |
Output is correct |
2 |
Correct |
55 ms |
68420 KB |
Output is correct |
3 |
Correct |
51 ms |
68424 KB |
Output is correct |
4 |
Correct |
47 ms |
68456 KB |
Output is correct |
5 |
Correct |
53 ms |
68464 KB |
Output is correct |
6 |
Correct |
47 ms |
68464 KB |
Output is correct |
7 |
Correct |
57 ms |
68368 KB |
Output is correct |
8 |
Correct |
44 ms |
68396 KB |
Output is correct |
9 |
Correct |
49 ms |
68436 KB |
Output is correct |
10 |
Correct |
47 ms |
68508 KB |
Output is correct |
11 |
Correct |
47 ms |
68480 KB |
Output is correct |
12 |
Correct |
48 ms |
68400 KB |
Output is correct |
13 |
Correct |
48 ms |
68464 KB |
Output is correct |
14 |
Correct |
46 ms |
68372 KB |
Output is correct |
15 |
Correct |
48 ms |
68516 KB |
Output is correct |
16 |
Correct |
53 ms |
68460 KB |
Output is correct |
17 |
Correct |
71 ms |
68424 KB |
Output is correct |
18 |
Correct |
46 ms |
68456 KB |
Output is correct |
19 |
Correct |
45 ms |
68372 KB |
Output is correct |
20 |
Correct |
45 ms |
68480 KB |
Output is correct |
21 |
Correct |
44 ms |
68428 KB |
Output is correct |
22 |
Correct |
46 ms |
68544 KB |
Output is correct |
23 |
Correct |
46 ms |
68420 KB |
Output is correct |
24 |
Correct |
46 ms |
68380 KB |
Output is correct |
25 |
Correct |
45 ms |
68464 KB |
Output is correct |
26 |
Correct |
47 ms |
68424 KB |
Output is correct |
27 |
Correct |
46 ms |
68476 KB |
Output is correct |
28 |
Correct |
49 ms |
68420 KB |
Output is correct |
29 |
Correct |
53 ms |
68428 KB |
Output is correct |
30 |
Correct |
51 ms |
68480 KB |
Output is correct |
31 |
Correct |
48 ms |
68480 KB |
Output is correct |
32 |
Correct |
52 ms |
68432 KB |
Output is correct |
33 |
Correct |
48 ms |
68428 KB |
Output is correct |
34 |
Correct |
57 ms |
68472 KB |
Output is correct |
35 |
Correct |
48 ms |
68420 KB |
Output is correct |
36 |
Correct |
47 ms |
68388 KB |
Output is correct |
37 |
Correct |
46 ms |
68384 KB |
Output is correct |
38 |
Correct |
46 ms |
68404 KB |
Output is correct |
39 |
Correct |
61 ms |
68408 KB |
Output is correct |
40 |
Correct |
51 ms |
68480 KB |
Output is correct |
41 |
Correct |
46 ms |
68376 KB |
Output is correct |
42 |
Correct |
46 ms |
68412 KB |
Output is correct |
43 |
Correct |
46 ms |
68392 KB |
Output is correct |
44 |
Correct |
53 ms |
68420 KB |
Output is correct |
45 |
Correct |
58 ms |
68416 KB |
Output is correct |
46 |
Correct |
61 ms |
68776 KB |
Output is correct |
47 |
Correct |
76 ms |
68768 KB |
Output is correct |
48 |
Correct |
60 ms |
68764 KB |
Output is correct |
49 |
Correct |
53 ms |
69068 KB |
Output is correct |
50 |
Correct |
58 ms |
69176 KB |
Output is correct |
51 |
Correct |
55 ms |
69056 KB |
Output is correct |
52 |
Correct |
57 ms |
68932 KB |
Output is correct |
53 |
Correct |
55 ms |
68892 KB |
Output is correct |
54 |
Correct |
59 ms |
68944 KB |
Output is correct |
55 |
Correct |
73 ms |
68904 KB |
Output is correct |
56 |
Correct |
80 ms |
68832 KB |
Output is correct |
57 |
Correct |
92 ms |
68788 KB |
Output is correct |
58 |
Correct |
71 ms |
68748 KB |
Output is correct |
59 |
Correct |
74 ms |
68804 KB |
Output is correct |
60 |
Correct |
69 ms |
68744 KB |
Output is correct |
61 |
Correct |
58 ms |
68832 KB |
Output is correct |
62 |
Correct |
53 ms |
68904 KB |
Output is correct |
63 |
Correct |
53 ms |
68828 KB |
Output is correct |
64 |
Correct |
67 ms |
68732 KB |
Output is correct |
65 |
Correct |
60 ms |
68752 KB |
Output is correct |
66 |
Correct |
70 ms |
68752 KB |
Output is correct |
67 |
Correct |
69 ms |
68660 KB |
Output is correct |
68 |
Correct |
52 ms |
69124 KB |
Output is correct |
69 |
Correct |
56 ms |
68940 KB |
Output is correct |
70 |
Correct |
55 ms |
68928 KB |
Output is correct |
71 |
Correct |
62 ms |
68820 KB |
Output is correct |
72 |
Correct |
69 ms |
68668 KB |
Output is correct |
73 |
Correct |
68 ms |
68672 KB |
Output is correct |
74 |
Correct |
65 ms |
68780 KB |
Output is correct |
75 |
Correct |
55 ms |
68848 KB |
Output is correct |
76 |
Correct |
66 ms |
68820 KB |
Output is correct |
77 |
Correct |
55 ms |
68804 KB |
Output is correct |
78 |
Correct |
55 ms |
68764 KB |
Output is correct |
79 |
Correct |
62 ms |
68716 KB |
Output is correct |
80 |
Correct |
55 ms |
68676 KB |
Output is correct |
81 |
Correct |
64 ms |
68848 KB |
Output is correct |
82 |
Correct |
60 ms |
68816 KB |
Output is correct |
83 |
Correct |
55 ms |
68756 KB |
Output is correct |
84 |
Correct |
59 ms |
68756 KB |
Output is correct |
85 |
Correct |
76 ms |
68684 KB |
Output is correct |
86 |
Correct |
58 ms |
68756 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
68424 KB |
Output is correct |
2 |
Correct |
55 ms |
68420 KB |
Output is correct |
3 |
Correct |
51 ms |
68424 KB |
Output is correct |
4 |
Correct |
47 ms |
68456 KB |
Output is correct |
5 |
Correct |
53 ms |
68464 KB |
Output is correct |
6 |
Correct |
47 ms |
68464 KB |
Output is correct |
7 |
Correct |
57 ms |
68368 KB |
Output is correct |
8 |
Correct |
44 ms |
68396 KB |
Output is correct |
9 |
Correct |
49 ms |
68436 KB |
Output is correct |
10 |
Correct |
47 ms |
68508 KB |
Output is correct |
11 |
Correct |
47 ms |
68480 KB |
Output is correct |
12 |
Correct |
48 ms |
68400 KB |
Output is correct |
13 |
Correct |
48 ms |
68464 KB |
Output is correct |
14 |
Correct |
46 ms |
68372 KB |
Output is correct |
15 |
Correct |
48 ms |
68516 KB |
Output is correct |
16 |
Correct |
53 ms |
68460 KB |
Output is correct |
17 |
Correct |
71 ms |
68424 KB |
Output is correct |
18 |
Correct |
46 ms |
68456 KB |
Output is correct |
19 |
Correct |
45 ms |
68372 KB |
Output is correct |
20 |
Correct |
45 ms |
68480 KB |
Output is correct |
21 |
Correct |
44 ms |
68428 KB |
Output is correct |
22 |
Correct |
46 ms |
68544 KB |
Output is correct |
23 |
Correct |
46 ms |
68420 KB |
Output is correct |
24 |
Correct |
46 ms |
68380 KB |
Output is correct |
25 |
Correct |
45 ms |
68464 KB |
Output is correct |
26 |
Correct |
47 ms |
68424 KB |
Output is correct |
27 |
Correct |
46 ms |
68476 KB |
Output is correct |
28 |
Correct |
49 ms |
68420 KB |
Output is correct |
29 |
Correct |
53 ms |
68428 KB |
Output is correct |
30 |
Correct |
51 ms |
68480 KB |
Output is correct |
31 |
Correct |
48 ms |
68480 KB |
Output is correct |
32 |
Correct |
52 ms |
68432 KB |
Output is correct |
33 |
Correct |
48 ms |
68428 KB |
Output is correct |
34 |
Correct |
57 ms |
68472 KB |
Output is correct |
35 |
Correct |
48 ms |
68420 KB |
Output is correct |
36 |
Correct |
47 ms |
68388 KB |
Output is correct |
37 |
Correct |
46 ms |
68384 KB |
Output is correct |
38 |
Correct |
46 ms |
68404 KB |
Output is correct |
39 |
Correct |
61 ms |
68408 KB |
Output is correct |
40 |
Correct |
51 ms |
68480 KB |
Output is correct |
41 |
Correct |
46 ms |
68376 KB |
Output is correct |
42 |
Correct |
46 ms |
68412 KB |
Output is correct |
43 |
Correct |
46 ms |
68392 KB |
Output is correct |
44 |
Correct |
53 ms |
68420 KB |
Output is correct |
45 |
Correct |
58 ms |
68416 KB |
Output is correct |
46 |
Correct |
61 ms |
68776 KB |
Output is correct |
47 |
Correct |
76 ms |
68768 KB |
Output is correct |
48 |
Correct |
60 ms |
68764 KB |
Output is correct |
49 |
Correct |
53 ms |
69068 KB |
Output is correct |
50 |
Correct |
58 ms |
69176 KB |
Output is correct |
51 |
Correct |
55 ms |
69056 KB |
Output is correct |
52 |
Correct |
57 ms |
68932 KB |
Output is correct |
53 |
Correct |
55 ms |
68892 KB |
Output is correct |
54 |
Correct |
59 ms |
68944 KB |
Output is correct |
55 |
Correct |
73 ms |
68904 KB |
Output is correct |
56 |
Correct |
80 ms |
68832 KB |
Output is correct |
57 |
Correct |
92 ms |
68788 KB |
Output is correct |
58 |
Correct |
71 ms |
68748 KB |
Output is correct |
59 |
Correct |
74 ms |
68804 KB |
Output is correct |
60 |
Correct |
69 ms |
68744 KB |
Output is correct |
61 |
Correct |
58 ms |
68832 KB |
Output is correct |
62 |
Correct |
53 ms |
68904 KB |
Output is correct |
63 |
Correct |
53 ms |
68828 KB |
Output is correct |
64 |
Correct |
67 ms |
68732 KB |
Output is correct |
65 |
Correct |
60 ms |
68752 KB |
Output is correct |
66 |
Correct |
70 ms |
68752 KB |
Output is correct |
67 |
Correct |
69 ms |
68660 KB |
Output is correct |
68 |
Correct |
52 ms |
69124 KB |
Output is correct |
69 |
Correct |
56 ms |
68940 KB |
Output is correct |
70 |
Correct |
55 ms |
68928 KB |
Output is correct |
71 |
Correct |
62 ms |
68820 KB |
Output is correct |
72 |
Correct |
69 ms |
68668 KB |
Output is correct |
73 |
Correct |
68 ms |
68672 KB |
Output is correct |
74 |
Correct |
65 ms |
68780 KB |
Output is correct |
75 |
Correct |
55 ms |
68848 KB |
Output is correct |
76 |
Correct |
66 ms |
68820 KB |
Output is correct |
77 |
Correct |
55 ms |
68804 KB |
Output is correct |
78 |
Correct |
55 ms |
68764 KB |
Output is correct |
79 |
Correct |
62 ms |
68716 KB |
Output is correct |
80 |
Correct |
55 ms |
68676 KB |
Output is correct |
81 |
Correct |
64 ms |
68848 KB |
Output is correct |
82 |
Correct |
60 ms |
68816 KB |
Output is correct |
83 |
Correct |
55 ms |
68756 KB |
Output is correct |
84 |
Correct |
59 ms |
68756 KB |
Output is correct |
85 |
Correct |
76 ms |
68684 KB |
Output is correct |
86 |
Correct |
58 ms |
68756 KB |
Output is correct |
87 |
Correct |
100 ms |
69548 KB |
Output is correct |
88 |
Correct |
190 ms |
71292 KB |
Output is correct |
89 |
Correct |
723 ms |
78184 KB |
Output is correct |
90 |
Correct |
720 ms |
78040 KB |
Output is correct |
91 |
Correct |
715 ms |
78020 KB |
Output is correct |
92 |
Correct |
226 ms |
87248 KB |
Output is correct |
93 |
Correct |
230 ms |
87272 KB |
Output is correct |
94 |
Correct |
249 ms |
87432 KB |
Output is correct |
95 |
Correct |
294 ms |
82176 KB |
Output is correct |
96 |
Correct |
256 ms |
82480 KB |
Output is correct |
97 |
Correct |
332 ms |
82552 KB |
Output is correct |
98 |
Correct |
290 ms |
82616 KB |
Output is correct |
99 |
Correct |
261 ms |
81976 KB |
Output is correct |
100 |
Correct |
1266 ms |
78244 KB |
Output is correct |
101 |
Correct |
1291 ms |
78560 KB |
Output is correct |
102 |
Correct |
1324 ms |
78632 KB |
Output is correct |
103 |
Correct |
1327 ms |
78600 KB |
Output is correct |
104 |
Correct |
291 ms |
81932 KB |
Output is correct |
105 |
Correct |
345 ms |
81972 KB |
Output is correct |
106 |
Correct |
302 ms |
81968 KB |
Output is correct |
107 |
Correct |
643 ms |
77220 KB |
Output is correct |
108 |
Correct |
647 ms |
77412 KB |
Output is correct |
109 |
Correct |
713 ms |
77636 KB |
Output is correct |
110 |
Correct |
231 ms |
86744 KB |
Output is correct |
111 |
Correct |
256 ms |
82116 KB |
Output is correct |
112 |
Correct |
244 ms |
81868 KB |
Output is correct |
113 |
Correct |
288 ms |
81308 KB |
Output is correct |
114 |
Correct |
1074 ms |
78148 KB |
Output is correct |
115 |
Correct |
1266 ms |
77948 KB |
Output is correct |
116 |
Correct |
316 ms |
81360 KB |
Output is correct |
117 |
Correct |
281 ms |
79732 KB |
Output is correct |
118 |
Correct |
330 ms |
79044 KB |
Output is correct |
119 |
Correct |
294 ms |
78740 KB |
Output is correct |
120 |
Correct |
278 ms |
79388 KB |
Output is correct |
121 |
Correct |
275 ms |
78776 KB |
Output is correct |
122 |
Correct |
276 ms |
78612 KB |
Output is correct |
123 |
Correct |
352 ms |
79864 KB |
Output is correct |
124 |
Correct |
326 ms |
79108 KB |
Output is correct |
125 |
Correct |
352 ms |
78744 KB |
Output is correct |
126 |
Correct |
380 ms |
79428 KB |
Output is correct |
127 |
Correct |
310 ms |
78844 KB |
Output is correct |
128 |
Correct |
391 ms |
78424 KB |
Output is correct |