#include<bits/stdc++.h>
using namespace std;
typedef long long llo;
//#include<bits/extc++.h>
//__gnu_pbds
const int MOD = 1e6+3;
/*
mantain a set of in process elements
repeatly remove elements from the leftmost or the rightmost side for which there doesn't exist a i<j<k such that hi>hj<hk
if(cnt>=2):
check for 4 number ll lr rl rr
some inequality
rl <= ll
lr <= rr
pick the smallest of rl,lr M
than suppose the current height is h, and there are cnt element in my set
let L = (M-h)
ans+= L(ll+M+rr+2*cnt-3)+(3*cnt-4)*(L*(h+M-1))/2;
h = M;
else:
find 2 numbers l, r
WLOG l<=r
ans += (h+l-1)(l-h)/2 + (l+r)(l-h)
*/
struct SEG{
vector<int> arr;
int n;
void init(int _n){
n = _n;
arr.resize(4*n,0);
}
void modify(int x,int v,int L,int R,int ind){
if(R==L){
arr[ind]=v;
return;
}
int M = (L+R)/2;
if(x<=M) modify(x,v,L,M,2*ind);
else modify(x,v,M+1,R,2*ind+1);
arr[ind] = min(arr[2*ind],arr[2*ind+1]);
}
int query(int l,int r,int L,int R,int ind){
if(l==L && r==R) return arr[ind];
int M = (L+R)/2;
if(r<=M) return query(l,r,L,M,2*ind);
if(l>M) return query(l,r,M+1,R,2*ind+1);
return min(query(l,M,L,M,2*ind),query(M+1,r,M+1,R,2*ind+1));
}
} seg;
int main(){
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n;cin>>n;
seg.init(n);
vector<int> h(n);
vector<int> d;
for(int i=0;i<n;i++){
cin>>h[i];
seg.modify(i,h[i],0,n-1,1);
d.push_back(h[i]);
}
sort(d.begin(),d.end());
d.resize(unique(d.begin(),d.end())-d.begin());
vector<vector<int> > V(d.size());
for(int i=0;i<n;i++){
int l = lower_bound(d.begin(),d.end(),h[i]) -d.begin();
V[l].push_back(i);
}
llo ans = 0;
set<int> s;
for(int F=0;F<d.size();F++){
for(auto i : V[F]){
s.insert(i);
seg.modify(i,1e9+5,0,n-1,1);
}
int H = d[F];
while(s.size()){
int cur = *s.begin();
int l = seg.query(0,cur,0,n-1,1);
int r = seg.query(cur,n-1,0,n-1,1);
if((l>1e9 || l<=H) || (r>1e9 || r<=H)){
s.erase(cur);
}
else break;
}
while(s.size()){
int cur = *s.rbegin();
int l = seg.query(0,cur,0,n-1,1);
int r = seg.query(cur,n-1,0,n-1,1);
if((l>1e9 || l<=H) || (r>1e9 || r<=H)){
s.erase(cur);
}
else break;
}
if(s.size()==1){
int cur = *s.begin();
int l = seg.query(0,cur,0,n-1,1);
int r = seg.query(cur,n-1,0,n-1,1);
if(l>r) swap(l,r);
ans = ((ans+(1LL*(H+l-1)*(l-H)/2)%MOD)%MOD + ((1LL*(l+r)*(l-H))%MOD))%MOD;
}else if(s.size()>1){
int cnt = s.size();
int ll = seg.query(0,*s.begin(),0,n-1,1);
int lr = seg.query(*s.begin(),n-1,0,n-1,1);
int rl = seg.query(0,*(s.rbegin()),0,n-1,1);
int rr = seg.query(*(s.rbegin()),n-1,0,n-1,1);
int M = min(lr,rl);
int hsum = (1LL*(M+H-1)*(M-H)/2)%MOD;
int A = (3LL*(cnt-1))%MOD;
int B = ((2*(cnt-2))+1+ll)%MOD+rr%MOD+M%MOD;
ans=(1LL*B*(M-H)%MOD+ans)%MOD;
ans=(ans+(1LL*A*hsum)%MOD)%MOD;
}
}
ans%=MOD;
if(ans<0) ans+=MOD;
cout<<ans<<"\n";
return 0;
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:74:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
74 | for(int F=0;F<d.size();F++){
| ~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
6 ms |
1116 KB |
Output is correct |
36 |
Correct |
5 ms |
1084 KB |
Output is correct |
37 |
Correct |
5 ms |
980 KB |
Output is correct |
38 |
Correct |
5 ms |
1116 KB |
Output is correct |
39 |
Correct |
5 ms |
940 KB |
Output is correct |
40 |
Correct |
3 ms |
860 KB |
Output is correct |
41 |
Correct |
3 ms |
860 KB |
Output is correct |
42 |
Correct |
3 ms |
720 KB |
Output is correct |
43 |
Correct |
6 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
964 KB |
Output is correct |
45 |
Correct |
5 ms |
1112 KB |
Output is correct |
46 |
Correct |
5 ms |
856 KB |
Output is correct |
47 |
Correct |
5 ms |
860 KB |
Output is correct |
48 |
Correct |
5 ms |
872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
6 ms |
1116 KB |
Output is correct |
36 |
Correct |
5 ms |
1084 KB |
Output is correct |
37 |
Correct |
5 ms |
980 KB |
Output is correct |
38 |
Correct |
5 ms |
1116 KB |
Output is correct |
39 |
Correct |
5 ms |
940 KB |
Output is correct |
40 |
Correct |
3 ms |
860 KB |
Output is correct |
41 |
Correct |
3 ms |
860 KB |
Output is correct |
42 |
Correct |
3 ms |
720 KB |
Output is correct |
43 |
Correct |
6 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
964 KB |
Output is correct |
45 |
Correct |
5 ms |
1112 KB |
Output is correct |
46 |
Correct |
5 ms |
856 KB |
Output is correct |
47 |
Correct |
5 ms |
860 KB |
Output is correct |
48 |
Correct |
5 ms |
872 KB |
Output is correct |
49 |
Correct |
5 ms |
1112 KB |
Output is correct |
50 |
Correct |
5 ms |
1116 KB |
Output is correct |
51 |
Correct |
5 ms |
1116 KB |
Output is correct |
52 |
Correct |
5 ms |
1116 KB |
Output is correct |
53 |
Correct |
5 ms |
1116 KB |
Output is correct |
54 |
Correct |
3 ms |
736 KB |
Output is correct |
55 |
Correct |
3 ms |
860 KB |
Output is correct |
56 |
Correct |
3 ms |
860 KB |
Output is correct |
57 |
Correct |
5 ms |
1116 KB |
Output is correct |
58 |
Correct |
5 ms |
1116 KB |
Output is correct |
59 |
Correct |
5 ms |
1116 KB |
Output is correct |
60 |
Correct |
5 ms |
1112 KB |
Output is correct |
61 |
Correct |
5 ms |
1116 KB |
Output is correct |
62 |
Correct |
5 ms |
1116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1105 ms |
79216 KB |
Output is correct |
36 |
Correct |
1143 ms |
79228 KB |
Output is correct |
37 |
Correct |
1077 ms |
78996 KB |
Output is correct |
38 |
Correct |
1070 ms |
78936 KB |
Output is correct |
39 |
Correct |
1128 ms |
78788 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
500 KB |
Output is correct |
42 |
Correct |
649 ms |
77372 KB |
Output is correct |
43 |
Correct |
647 ms |
77348 KB |
Output is correct |
44 |
Correct |
629 ms |
77248 KB |
Output is correct |
45 |
Correct |
568 ms |
78920 KB |
Output is correct |
46 |
Correct |
562 ms |
78996 KB |
Output is correct |
47 |
Correct |
559 ms |
79212 KB |
Output is correct |
48 |
Correct |
668 ms |
79184 KB |
Output is correct |
49 |
Correct |
656 ms |
79028 KB |
Output is correct |
50 |
Correct |
648 ms |
79052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
6 ms |
1116 KB |
Output is correct |
36 |
Correct |
5 ms |
1084 KB |
Output is correct |
37 |
Correct |
5 ms |
980 KB |
Output is correct |
38 |
Correct |
5 ms |
1116 KB |
Output is correct |
39 |
Correct |
5 ms |
940 KB |
Output is correct |
40 |
Correct |
3 ms |
860 KB |
Output is correct |
41 |
Correct |
3 ms |
860 KB |
Output is correct |
42 |
Correct |
3 ms |
720 KB |
Output is correct |
43 |
Correct |
6 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
964 KB |
Output is correct |
45 |
Correct |
5 ms |
1112 KB |
Output is correct |
46 |
Correct |
5 ms |
856 KB |
Output is correct |
47 |
Correct |
5 ms |
860 KB |
Output is correct |
48 |
Correct |
5 ms |
872 KB |
Output is correct |
49 |
Correct |
1105 ms |
79216 KB |
Output is correct |
50 |
Correct |
1143 ms |
79228 KB |
Output is correct |
51 |
Correct |
1077 ms |
78996 KB |
Output is correct |
52 |
Correct |
1070 ms |
78936 KB |
Output is correct |
53 |
Correct |
1128 ms |
78788 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
1 ms |
500 KB |
Output is correct |
56 |
Correct |
649 ms |
77372 KB |
Output is correct |
57 |
Correct |
647 ms |
77348 KB |
Output is correct |
58 |
Correct |
629 ms |
77248 KB |
Output is correct |
59 |
Correct |
568 ms |
78920 KB |
Output is correct |
60 |
Correct |
562 ms |
78996 KB |
Output is correct |
61 |
Correct |
559 ms |
79212 KB |
Output is correct |
62 |
Correct |
668 ms |
79184 KB |
Output is correct |
63 |
Correct |
656 ms |
79028 KB |
Output is correct |
64 |
Correct |
648 ms |
79052 KB |
Output is correct |
65 |
Correct |
2167 ms |
112416 KB |
Output is correct |
66 |
Correct |
2188 ms |
112464 KB |
Output is correct |
67 |
Correct |
2224 ms |
112124 KB |
Output is correct |
68 |
Correct |
2201 ms |
112424 KB |
Output is correct |
69 |
Correct |
2160 ms |
112348 KB |
Output is correct |
70 |
Correct |
663 ms |
77300 KB |
Output is correct |
71 |
Correct |
680 ms |
77708 KB |
Output is correct |
72 |
Correct |
653 ms |
77444 KB |
Output is correct |
73 |
Correct |
1092 ms |
112348 KB |
Output is correct |
74 |
Correct |
1120 ms |
112356 KB |
Output is correct |
75 |
Correct |
1145 ms |
112216 KB |
Output is correct |
76 |
Correct |
1404 ms |
112136 KB |
Output is correct |
77 |
Correct |
1274 ms |
112304 KB |
Output is correct |
78 |
Correct |
1285 ms |
111844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
864 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
756 KB |
Output is correct |
11 |
Correct |
3 ms |
844 KB |
Output is correct |
12 |
Correct |
3 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
644 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
5 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
724 KB |
Output is correct |
19 |
Correct |
4 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
860 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
860 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
600 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
6 ms |
1116 KB |
Output is correct |
36 |
Correct |
5 ms |
1084 KB |
Output is correct |
37 |
Correct |
5 ms |
980 KB |
Output is correct |
38 |
Correct |
5 ms |
1116 KB |
Output is correct |
39 |
Correct |
5 ms |
940 KB |
Output is correct |
40 |
Correct |
3 ms |
860 KB |
Output is correct |
41 |
Correct |
3 ms |
860 KB |
Output is correct |
42 |
Correct |
3 ms |
720 KB |
Output is correct |
43 |
Correct |
6 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
964 KB |
Output is correct |
45 |
Correct |
5 ms |
1112 KB |
Output is correct |
46 |
Correct |
5 ms |
856 KB |
Output is correct |
47 |
Correct |
5 ms |
860 KB |
Output is correct |
48 |
Correct |
5 ms |
872 KB |
Output is correct |
49 |
Correct |
5 ms |
1112 KB |
Output is correct |
50 |
Correct |
5 ms |
1116 KB |
Output is correct |
51 |
Correct |
5 ms |
1116 KB |
Output is correct |
52 |
Correct |
5 ms |
1116 KB |
Output is correct |
53 |
Correct |
5 ms |
1116 KB |
Output is correct |
54 |
Correct |
3 ms |
736 KB |
Output is correct |
55 |
Correct |
3 ms |
860 KB |
Output is correct |
56 |
Correct |
3 ms |
860 KB |
Output is correct |
57 |
Correct |
5 ms |
1116 KB |
Output is correct |
58 |
Correct |
5 ms |
1116 KB |
Output is correct |
59 |
Correct |
5 ms |
1116 KB |
Output is correct |
60 |
Correct |
5 ms |
1112 KB |
Output is correct |
61 |
Correct |
5 ms |
1116 KB |
Output is correct |
62 |
Correct |
5 ms |
1116 KB |
Output is correct |
63 |
Correct |
1105 ms |
79216 KB |
Output is correct |
64 |
Correct |
1143 ms |
79228 KB |
Output is correct |
65 |
Correct |
1077 ms |
78996 KB |
Output is correct |
66 |
Correct |
1070 ms |
78936 KB |
Output is correct |
67 |
Correct |
1128 ms |
78788 KB |
Output is correct |
68 |
Correct |
1 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
500 KB |
Output is correct |
70 |
Correct |
649 ms |
77372 KB |
Output is correct |
71 |
Correct |
647 ms |
77348 KB |
Output is correct |
72 |
Correct |
629 ms |
77248 KB |
Output is correct |
73 |
Correct |
568 ms |
78920 KB |
Output is correct |
74 |
Correct |
562 ms |
78996 KB |
Output is correct |
75 |
Correct |
559 ms |
79212 KB |
Output is correct |
76 |
Correct |
668 ms |
79184 KB |
Output is correct |
77 |
Correct |
656 ms |
79028 KB |
Output is correct |
78 |
Correct |
648 ms |
79052 KB |
Output is correct |
79 |
Correct |
2167 ms |
112416 KB |
Output is correct |
80 |
Correct |
2188 ms |
112464 KB |
Output is correct |
81 |
Correct |
2224 ms |
112124 KB |
Output is correct |
82 |
Correct |
2201 ms |
112424 KB |
Output is correct |
83 |
Correct |
2160 ms |
112348 KB |
Output is correct |
84 |
Correct |
663 ms |
77300 KB |
Output is correct |
85 |
Correct |
680 ms |
77708 KB |
Output is correct |
86 |
Correct |
653 ms |
77444 KB |
Output is correct |
87 |
Correct |
1092 ms |
112348 KB |
Output is correct |
88 |
Correct |
1120 ms |
112356 KB |
Output is correct |
89 |
Correct |
1145 ms |
112216 KB |
Output is correct |
90 |
Correct |
1404 ms |
112136 KB |
Output is correct |
91 |
Correct |
1274 ms |
112304 KB |
Output is correct |
92 |
Correct |
1285 ms |
111844 KB |
Output is correct |
93 |
Correct |
639 ms |
77712 KB |
Output is correct |
94 |
Correct |
1260 ms |
135332 KB |
Output is correct |
95 |
Correct |
1255 ms |
135352 KB |
Output is correct |
96 |
Correct |
1285 ms |
135140 KB |
Output is correct |
97 |
Correct |
1421 ms |
134944 KB |
Output is correct |
98 |
Correct |
1471 ms |
135128 KB |
Output is correct |
99 |
Correct |
1471 ms |
135224 KB |
Output is correct |
100 |
Correct |
2478 ms |
135580 KB |
Output is correct |
101 |
Correct |
2465 ms |
135160 KB |
Output is correct |
102 |
Correct |
2435 ms |
135496 KB |
Output is correct |
103 |
Correct |
2426 ms |
135240 KB |
Output is correct |
104 |
Correct |
2475 ms |
135216 KB |
Output is correct |
105 |
Correct |
646 ms |
77256 KB |
Output is correct |
106 |
Correct |
621 ms |
77252 KB |
Output is correct |