#include<bits/stdc++.h>
#define fori(i,a,b) for(int i = a;i <= b; i++)
#define int long long
#define pb push_back
using namespace std;
typedef pair<int,int> ii;
typedef tuple<int,int,int> tp;
const int M = 1e6 + 10;
const int N = 5e3 + 10;
const int mod = 1e6 + 3;
int n,h[M];
int target[M];
vector<int> in[M],out[M];
vector<int> rrh;
int calc(int l,int r) {
return ((l + r) * (r - l + 1) / 2) % mod;
}
int t[4 * M];
void build(int s,int l, int r)
{
if(l == r) {
t[s] = h[l];
return ;
}
int mid = (l + r)/2;
build(s * 2,l,mid);
build(s * 2 + 1, mid + 1, r);
t[s] = min(t[s * 2] , t[s * 2 + 1]);
}
void upd(int s,int l, int r, int pos, int val)
{
if(l > pos || pos > r) return ;
if(l == r) {
t[s] = val;
return ;
}
int mid = (l + r)/2;
upd(s * 2, l, mid, pos, val);
upd(s * 2 + 1, mid + 1, r, pos, val);
t[s] = min(t[s * 2],t[s * 2 + 1]);
}
int get(int s, int l, int r, int u, int v)
{
if(l > v || r < u) return 1e9;
if(u <= l && r <= v) return t[s];
int mid = (l + r)/2;
return min(get(s * 2, l, mid, u, v),get(s * 2 + 1, mid + 1, r, u, v));
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if(fopen("1.inp","r"))
{
freopen("1.inp","r",stdin);
freopen("1.out","w",stdout);
}
#define task ""
if(fopen(task".inp","r"))
{
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
cin >> n;
for(int i = 1;i <= n; i++) cin >> h[i];
build(1,1,n);
int suf = 0,pre = 0;
for(int i = 1;i <= n; i++) {
pre = max(pre, h[i]);
target[i] = pre ;
}
for(int i = n; i != 0; i--) {
suf = max(suf, h[i]);
target[i] = min(target[i], suf);
}
for(int i = 1;i <= n; i++) rrh.pb(h[i]);
sort(rrh.begin(),rrh.end());
rrh.resize(unique (rrh.begin(), rrh.end()) - rrh.begin());
for(int i = 1;i <= n; i++) {
h[i] = lower_bound(rrh.begin(),rrh.end(),h[i]) - rrh.begin() ;
target[i] = lower_bound(rrh.begin(),rrh.end(),target[i]) - rrh.begin() ;
if(h[i] != target[i]) {
out[target[i]].pb(i);
}
in[h[i]].pb(i);
}
int kq = 0;
int m= rrh.size();
set<int> s;
for(int high = 0;high <= m - 2; high ++) {
for(int idx : in[high]) {
if(h[idx] != target[idx]) s.insert(idx);
upd(1,1,n,idx,1e9);
}
int sz = s.size();
if(sz == 0) continue;
int val = rrh[high] % mod;
int nxt_val = rrh[high + 1] % mod;
if(sz == 1) {
int cur = *s.begin();
int x = get(1, 1, n, 1, cur - 1) , y = get(1, 1, n, cur + 1, n);
x %= mod;
y %= mod;
kq = (kq + (nxt_val - val)*(x + y) % mod ) % mod;
}
else {
int l = *s.begin(), r = *s.rbegin();
int pre_l = get(1, 1, n, 1, l - 1) , pre_r = get(1, 1, n, 1, r - 1) ,
suf_l = get(1, 1, n, l + 1, n) , suf_r = get(1, 1, n, r + 1, n);
int x =(rrh[high + 1] - rrh[high]) * (pre_l + suf_l) + (rrh[high + 1] - rrh[high]) * suf_r ;
int y =(rrh[high + 1] - rrh[high]) * (pre_r + suf_r) + (rrh[high + 1] - rrh[high]) * pre_l ;
x = min(x,y) % mod;
kq = (kq + x) % mod;
kq = ( kq + (sz - 2) * 2ll * calc(val + 1 ,nxt_val) % mod + calc(val + 1,nxt_val)) % mod;
}
kq = (kq + sz * calc(val,nxt_val - 1) % mod) % mod;
for(int idx : out[high + 1]) s.erase(idx);
}
cout << (kq + mod) % mod;
}
Compilation message
Main.cpp: In function 'int32_t main()':
Main.cpp:64:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
64 | freopen("1.inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:65:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
65 | freopen("1.out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
Main.cpp:70:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
70 | freopen(task".inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:71:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
71 | freopen(task".out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
35 |
Correct |
21 ms |
50392 KB |
Output is correct |
36 |
Correct |
26 ms |
50256 KB |
Output is correct |
37 |
Correct |
21 ms |
50256 KB |
Output is correct |
38 |
Correct |
18 ms |
50256 KB |
Output is correct |
39 |
Correct |
24 ms |
50256 KB |
Output is correct |
40 |
Correct |
17 ms |
50256 KB |
Output is correct |
41 |
Correct |
16 ms |
52048 KB |
Output is correct |
42 |
Correct |
19 ms |
50132 KB |
Output is correct |
43 |
Correct |
19 ms |
50372 KB |
Output is correct |
44 |
Correct |
17 ms |
50256 KB |
Output is correct |
45 |
Correct |
23 ms |
50256 KB |
Output is correct |
46 |
Correct |
23 ms |
50256 KB |
Output is correct |
47 |
Correct |
22 ms |
50256 KB |
Output is correct |
48 |
Correct |
23 ms |
50336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
35 |
Correct |
21 ms |
50392 KB |
Output is correct |
36 |
Correct |
26 ms |
50256 KB |
Output is correct |
37 |
Correct |
21 ms |
50256 KB |
Output is correct |
38 |
Correct |
18 ms |
50256 KB |
Output is correct |
39 |
Correct |
24 ms |
50256 KB |
Output is correct |
40 |
Correct |
17 ms |
50256 KB |
Output is correct |
41 |
Correct |
16 ms |
52048 KB |
Output is correct |
42 |
Correct |
19 ms |
50132 KB |
Output is correct |
43 |
Correct |
19 ms |
50372 KB |
Output is correct |
44 |
Correct |
17 ms |
50256 KB |
Output is correct |
45 |
Correct |
23 ms |
50256 KB |
Output is correct |
46 |
Correct |
23 ms |
50256 KB |
Output is correct |
47 |
Correct |
22 ms |
50256 KB |
Output is correct |
48 |
Correct |
23 ms |
50336 KB |
Output is correct |
49 |
Correct |
21 ms |
50256 KB |
Output is correct |
50 |
Correct |
22 ms |
50428 KB |
Output is correct |
51 |
Correct |
25 ms |
50240 KB |
Output is correct |
52 |
Correct |
19 ms |
50256 KB |
Output is correct |
53 |
Correct |
21 ms |
50256 KB |
Output is correct |
54 |
Correct |
19 ms |
50424 KB |
Output is correct |
55 |
Correct |
17 ms |
50256 KB |
Output is correct |
56 |
Correct |
16 ms |
50292 KB |
Output is correct |
57 |
Correct |
14 ms |
50256 KB |
Output is correct |
58 |
Correct |
18 ms |
50232 KB |
Output is correct |
59 |
Correct |
18 ms |
50428 KB |
Output is correct |
60 |
Correct |
21 ms |
50308 KB |
Output is correct |
61 |
Correct |
20 ms |
50424 KB |
Output is correct |
62 |
Correct |
18 ms |
50236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
35 |
Correct |
930 ms |
156404 KB |
Output is correct |
36 |
Correct |
901 ms |
156184 KB |
Output is correct |
37 |
Correct |
1125 ms |
156572 KB |
Output is correct |
38 |
Correct |
1162 ms |
156624 KB |
Output is correct |
39 |
Correct |
942 ms |
156324 KB |
Output is correct |
40 |
Correct |
16 ms |
49744 KB |
Output is correct |
41 |
Correct |
16 ms |
49744 KB |
Output is correct |
42 |
Correct |
548 ms |
154076 KB |
Output is correct |
43 |
Correct |
542 ms |
153916 KB |
Output is correct |
44 |
Correct |
589 ms |
154024 KB |
Output is correct |
45 |
Correct |
504 ms |
156376 KB |
Output is correct |
46 |
Correct |
496 ms |
156324 KB |
Output is correct |
47 |
Correct |
508 ms |
156580 KB |
Output is correct |
48 |
Correct |
656 ms |
156820 KB |
Output is correct |
49 |
Correct |
655 ms |
156540 KB |
Output is correct |
50 |
Correct |
641 ms |
156236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
35 |
Correct |
21 ms |
50392 KB |
Output is correct |
36 |
Correct |
26 ms |
50256 KB |
Output is correct |
37 |
Correct |
21 ms |
50256 KB |
Output is correct |
38 |
Correct |
18 ms |
50256 KB |
Output is correct |
39 |
Correct |
24 ms |
50256 KB |
Output is correct |
40 |
Correct |
17 ms |
50256 KB |
Output is correct |
41 |
Correct |
16 ms |
52048 KB |
Output is correct |
42 |
Correct |
19 ms |
50132 KB |
Output is correct |
43 |
Correct |
19 ms |
50372 KB |
Output is correct |
44 |
Correct |
17 ms |
50256 KB |
Output is correct |
45 |
Correct |
23 ms |
50256 KB |
Output is correct |
46 |
Correct |
23 ms |
50256 KB |
Output is correct |
47 |
Correct |
22 ms |
50256 KB |
Output is correct |
48 |
Correct |
23 ms |
50336 KB |
Output is correct |
49 |
Correct |
930 ms |
156404 KB |
Output is correct |
50 |
Correct |
901 ms |
156184 KB |
Output is correct |
51 |
Correct |
1125 ms |
156572 KB |
Output is correct |
52 |
Correct |
1162 ms |
156624 KB |
Output is correct |
53 |
Correct |
942 ms |
156324 KB |
Output is correct |
54 |
Correct |
16 ms |
49744 KB |
Output is correct |
55 |
Correct |
16 ms |
49744 KB |
Output is correct |
56 |
Correct |
548 ms |
154076 KB |
Output is correct |
57 |
Correct |
542 ms |
153916 KB |
Output is correct |
58 |
Correct |
589 ms |
154024 KB |
Output is correct |
59 |
Correct |
504 ms |
156376 KB |
Output is correct |
60 |
Correct |
496 ms |
156324 KB |
Output is correct |
61 |
Correct |
508 ms |
156580 KB |
Output is correct |
62 |
Correct |
656 ms |
156820 KB |
Output is correct |
63 |
Correct |
655 ms |
156540 KB |
Output is correct |
64 |
Correct |
641 ms |
156236 KB |
Output is correct |
65 |
Correct |
2141 ms |
168908 KB |
Output is correct |
66 |
Correct |
2338 ms |
169064 KB |
Output is correct |
67 |
Correct |
2481 ms |
168612 KB |
Output is correct |
68 |
Correct |
2441 ms |
168376 KB |
Output is correct |
69 |
Correct |
2287 ms |
168824 KB |
Output is correct |
70 |
Correct |
487 ms |
154024 KB |
Output is correct |
71 |
Correct |
569 ms |
154068 KB |
Output is correct |
72 |
Correct |
542 ms |
154296 KB |
Output is correct |
73 |
Correct |
1040 ms |
169204 KB |
Output is correct |
74 |
Correct |
1032 ms |
168520 KB |
Output is correct |
75 |
Correct |
1061 ms |
168848 KB |
Output is correct |
76 |
Correct |
1428 ms |
169896 KB |
Output is correct |
77 |
Correct |
1386 ms |
169636 KB |
Output is correct |
78 |
Correct |
1436 ms |
168976 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
49488 KB |
Output is correct |
2 |
Correct |
20 ms |
49708 KB |
Output is correct |
3 |
Correct |
22 ms |
47440 KB |
Output is correct |
4 |
Correct |
40 ms |
47968 KB |
Output is correct |
5 |
Correct |
16 ms |
50000 KB |
Output is correct |
6 |
Correct |
19 ms |
50000 KB |
Output is correct |
7 |
Correct |
17 ms |
50000 KB |
Output is correct |
8 |
Correct |
19 ms |
52048 KB |
Output is correct |
9 |
Correct |
13 ms |
50000 KB |
Output is correct |
10 |
Correct |
20 ms |
50004 KB |
Output is correct |
11 |
Correct |
21 ms |
50256 KB |
Output is correct |
12 |
Correct |
31 ms |
48028 KB |
Output is correct |
13 |
Correct |
21 ms |
49836 KB |
Output is correct |
14 |
Correct |
29 ms |
47280 KB |
Output is correct |
15 |
Correct |
23 ms |
47808 KB |
Output is correct |
16 |
Correct |
16 ms |
50128 KB |
Output is correct |
17 |
Correct |
26 ms |
50256 KB |
Output is correct |
18 |
Correct |
21 ms |
50256 KB |
Output is correct |
19 |
Correct |
31 ms |
47844 KB |
Output is correct |
20 |
Correct |
31 ms |
49744 KB |
Output is correct |
21 |
Correct |
29 ms |
47956 KB |
Output is correct |
22 |
Correct |
22 ms |
50256 KB |
Output is correct |
23 |
Correct |
32 ms |
47952 KB |
Output is correct |
24 |
Correct |
29 ms |
47952 KB |
Output is correct |
25 |
Correct |
27 ms |
47964 KB |
Output is correct |
26 |
Correct |
26 ms |
47952 KB |
Output is correct |
27 |
Correct |
28 ms |
49784 KB |
Output is correct |
28 |
Correct |
25 ms |
49744 KB |
Output is correct |
29 |
Correct |
22 ms |
49232 KB |
Output is correct |
30 |
Correct |
11 ms |
49488 KB |
Output is correct |
31 |
Correct |
21 ms |
47240 KB |
Output is correct |
32 |
Correct |
34 ms |
47440 KB |
Output is correct |
33 |
Correct |
26 ms |
47432 KB |
Output is correct |
34 |
Correct |
22 ms |
49248 KB |
Output is correct |
35 |
Correct |
21 ms |
50392 KB |
Output is correct |
36 |
Correct |
26 ms |
50256 KB |
Output is correct |
37 |
Correct |
21 ms |
50256 KB |
Output is correct |
38 |
Correct |
18 ms |
50256 KB |
Output is correct |
39 |
Correct |
24 ms |
50256 KB |
Output is correct |
40 |
Correct |
17 ms |
50256 KB |
Output is correct |
41 |
Correct |
16 ms |
52048 KB |
Output is correct |
42 |
Correct |
19 ms |
50132 KB |
Output is correct |
43 |
Correct |
19 ms |
50372 KB |
Output is correct |
44 |
Correct |
17 ms |
50256 KB |
Output is correct |
45 |
Correct |
23 ms |
50256 KB |
Output is correct |
46 |
Correct |
23 ms |
50256 KB |
Output is correct |
47 |
Correct |
22 ms |
50256 KB |
Output is correct |
48 |
Correct |
23 ms |
50336 KB |
Output is correct |
49 |
Correct |
21 ms |
50256 KB |
Output is correct |
50 |
Correct |
22 ms |
50428 KB |
Output is correct |
51 |
Correct |
25 ms |
50240 KB |
Output is correct |
52 |
Correct |
19 ms |
50256 KB |
Output is correct |
53 |
Correct |
21 ms |
50256 KB |
Output is correct |
54 |
Correct |
19 ms |
50424 KB |
Output is correct |
55 |
Correct |
17 ms |
50256 KB |
Output is correct |
56 |
Correct |
16 ms |
50292 KB |
Output is correct |
57 |
Correct |
14 ms |
50256 KB |
Output is correct |
58 |
Correct |
18 ms |
50232 KB |
Output is correct |
59 |
Correct |
18 ms |
50428 KB |
Output is correct |
60 |
Correct |
21 ms |
50308 KB |
Output is correct |
61 |
Correct |
20 ms |
50424 KB |
Output is correct |
62 |
Correct |
18 ms |
50236 KB |
Output is correct |
63 |
Correct |
930 ms |
156404 KB |
Output is correct |
64 |
Correct |
901 ms |
156184 KB |
Output is correct |
65 |
Correct |
1125 ms |
156572 KB |
Output is correct |
66 |
Correct |
1162 ms |
156624 KB |
Output is correct |
67 |
Correct |
942 ms |
156324 KB |
Output is correct |
68 |
Correct |
16 ms |
49744 KB |
Output is correct |
69 |
Correct |
16 ms |
49744 KB |
Output is correct |
70 |
Correct |
548 ms |
154076 KB |
Output is correct |
71 |
Correct |
542 ms |
153916 KB |
Output is correct |
72 |
Correct |
589 ms |
154024 KB |
Output is correct |
73 |
Correct |
504 ms |
156376 KB |
Output is correct |
74 |
Correct |
496 ms |
156324 KB |
Output is correct |
75 |
Correct |
508 ms |
156580 KB |
Output is correct |
76 |
Correct |
656 ms |
156820 KB |
Output is correct |
77 |
Correct |
655 ms |
156540 KB |
Output is correct |
78 |
Correct |
641 ms |
156236 KB |
Output is correct |
79 |
Correct |
2141 ms |
168908 KB |
Output is correct |
80 |
Correct |
2338 ms |
169064 KB |
Output is correct |
81 |
Correct |
2481 ms |
168612 KB |
Output is correct |
82 |
Correct |
2441 ms |
168376 KB |
Output is correct |
83 |
Correct |
2287 ms |
168824 KB |
Output is correct |
84 |
Correct |
487 ms |
154024 KB |
Output is correct |
85 |
Correct |
569 ms |
154068 KB |
Output is correct |
86 |
Correct |
542 ms |
154296 KB |
Output is correct |
87 |
Correct |
1040 ms |
169204 KB |
Output is correct |
88 |
Correct |
1032 ms |
168520 KB |
Output is correct |
89 |
Correct |
1061 ms |
168848 KB |
Output is correct |
90 |
Correct |
1428 ms |
169896 KB |
Output is correct |
91 |
Correct |
1386 ms |
169636 KB |
Output is correct |
92 |
Correct |
1436 ms |
168976 KB |
Output is correct |
93 |
Correct |
525 ms |
154276 KB |
Output is correct |
94 |
Correct |
1150 ms |
181364 KB |
Output is correct |
95 |
Correct |
1167 ms |
182540 KB |
Output is correct |
96 |
Correct |
1225 ms |
181768 KB |
Output is correct |
97 |
Correct |
1592 ms |
181660 KB |
Output is correct |
98 |
Correct |
1414 ms |
182184 KB |
Output is correct |
99 |
Correct |
1590 ms |
180948 KB |
Output is correct |
100 |
Correct |
2416 ms |
181768 KB |
Output is correct |
101 |
Correct |
2453 ms |
181256 KB |
Output is correct |
102 |
Correct |
2574 ms |
182860 KB |
Output is correct |
103 |
Correct |
2745 ms |
180892 KB |
Output is correct |
104 |
Correct |
2446 ms |
181440 KB |
Output is correct |
105 |
Correct |
560 ms |
154276 KB |
Output is correct |
106 |
Correct |
540 ms |
154020 KB |
Output is correct |