#include <bits/stdc++.h>
#include "towers.h"
using namespace std;
int N, spec, first;
vector<int> H, lw, good, prefix;
vector<pair<int, int>> candidates;
vector<vector<pair<int, int>>> mn, mx;
void precalcmx(){
mx.assign(20, vector<pair<int, int>>(N));
for(int k = 0; k < 20; k++){
for(int i = 0; i < N; i++){
if(k == 0) mx[k][i] = {H[i], i};
else{
if(i - (1 << (k-1)) < 0) mx[k][i] = mx[k-1][i];
else{
mx[k][i] = max(mx[k-1][i], mx[k-1][i - (1 << (k-1))]);
}
}
}
}
}
void precalcmn(){
mn.assign(20, vector<pair<int, int>>(N));
for(int k = 0; k < 20; k++){
for(int i = 0; i < N; i++){
if(k == 0) mn[k][i] = {H[i], i};
else{
if(i - (1 << (k-1)) < 0) mn[k][i] = mn[k-1][i];
else{
mn[k][i] = min(mn[k-1][i], mn[k-1][i - (1 << (k-1))]);
}
}
}
}
}
void precalclw(){
lw.resize(N+1);
int pw = 0;
int curr = 2;
for(int i = 1; i <= N; i++){
if(i == curr){
pw++; curr *= 2;
}
lw[i] = pw;
}
}
pair<int, int> get_mx(int l, int r){
if(r < l) return {-2e9, 0};
int k = lw[r - l + 1];
return max(mx[k][r], mx[k][l + (1 << k) - 1]);
}
pair<int, int> get_mn(int l, int r){
if(r < l) return {2e9, 0};
int k = lw[r - l + 1];
return min(mn[k][r], mn[k][l + (1 << k) - 1]);
}
int get_first(int L){
int lo = L;
int hi = N - 1;
int bst = -1;
int beat = 0;
if(L > 0) beat = prefix[L-1];
while(lo <= hi){
int mid = (lo + hi) / 2;
if(prefix[mid] > beat){
bst = mid;
hi = mid - 1;
}else lo = mid + 1;
}
assert(bst != -1);
return bst;
}
int get_last(int R){
int lo = 0;
int hi = R;
int bst = -1;
while(lo <= hi){
int mid = (lo + hi) / 2;
if(prefix[mid] <= prefix[R] - 1){
bst = mid;
lo = mid + 1;
}else hi = mid - 1;
}
return bst + 1;
}
void init(int n, vector<int> H1) {
N = n;
H = H1;
good.assign(N, 0);
spec = 0;
first = 1;
bool asc = 1;
for(int i = 1; i < N; i++){
if(spec == -1) break;
if(H[i] > H[i-1]){
if(asc) spec = i;
else spec = -1;
}else{
asc = 0;
}
}
precalcmx();
precalcmn();
precalclw();
}
int dnc(int L, int R, int D) {
if(L == R) {
return H[L];
}else if(L > R){
return 2e9;
}
pair<int, int> pr = get_mx(L, R);
int mx = pr.first;
int ind = pr.second;
int mn1 = dnc(ind + 1, R, D);
int mn2 = dnc(L, ind - 1, D);
if(mn1 <= mx - D && mn2 <= mx - D) good[ind] = 1;
candidates.push_back({min(mx - mn1, mx - mn2), ind});
return min(mn1, mn2);
}
int max_towers(int L, int R, int D) {
if(spec == -1){
if(first == 1){
dnc(0, N-1, D);
sort(candidates.begin(), candidates.end());
prefix.resize(N);
for(int i = 0; i < N; i++){
if(i == 0) prefix[i] = good[i];
else prefix[i] = prefix[i-1] + good[i];
}
first = 0;
}
if(L == 0 && R == N - 1){
int lo = 0;
int hi = (int)candidates.size() - 1;
int bst = (int)candidates.size();
while(lo <= hi){
int mid = (lo + hi) / 2;
if(candidates[mid].first >= D){
bst = mid;
hi = mid - 1;
}else lo = mid + 1;
}
return (int)candidates.size() - bst + 1;
}else{
int total = prefix[R];
if(L > 0) total -= prefix[L - 1];
if(total == 0) return 1;
else if(total == 1){
int ind = get_first(L);
int mn1 = get_mn(L, ind - 1).first;
int mn2 = get_mn(ind + 1, R).first;
if(mn1 <= H[ind] - D && mn2 <= H[ind] - D) return 2;
else return 1;
}else{
int ans = total + 1;
int ind = get_first(L);
int mn = get_mn(L, ind - 1).first;
if(mn > H[ind] - D) ans--;
ind = get_last(R);
mn = get_mn(ind + 1, R).first;
if(mn > H[ind] - D) ans--;
return ans;
}
}
}else{
int ans = 1;
if(L < spec && R > spec && H[L] <= H[spec] - D && H[R] <= H[spec] - D) ans++;
return ans;
}
}
// int main() {
// int N, Q;
// assert(2 == scanf("%d %d", &N, &Q));
// std::vector<int> H(N);
// for (int i = 0; i < N; ++i) {
// assert(1 == scanf("%d", &H[i]));
// }
// init(N, H);
// for (int i = 0; i < Q; ++i) {
// int L, R, D;
// assert(3 == scanf("%d %d %d", &L, &R, &D));
// printf("%d\n", max_towers(L, R, D));
// }
// return 0;
// }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
296 ms |
20344 KB |
Output is correct |
2 |
Correct |
646 ms |
33976 KB |
Output is correct |
3 |
Correct |
675 ms |
33956 KB |
Output is correct |
4 |
Correct |
793 ms |
33932 KB |
Output is correct |
5 |
Correct |
754 ms |
34012 KB |
Output is correct |
6 |
Correct |
623 ms |
33932 KB |
Output is correct |
7 |
Correct |
779 ms |
33948 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
1 ms |
848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
976 KB |
Output is correct |
4 |
Correct |
1 ms |
976 KB |
Output is correct |
5 |
Correct |
1 ms |
976 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
976 KB |
Output is correct |
8 |
Correct |
1 ms |
848 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
1104 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
1 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
2 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
1 ms |
848 KB |
Output is correct |
18 |
Correct |
1 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
848 KB |
Output is correct |
22 |
Correct |
1 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
864 KB |
Output is correct |
24 |
Correct |
1 ms |
1104 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
1 ms |
992 KB |
Output is correct |
27 |
Correct |
1 ms |
976 KB |
Output is correct |
28 |
Correct |
1 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
976 KB |
Output is correct |
32 |
Correct |
1 ms |
848 KB |
Output is correct |
33 |
Correct |
1 ms |
848 KB |
Output is correct |
34 |
Correct |
1 ms |
976 KB |
Output is correct |
35 |
Correct |
1 ms |
1104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
976 KB |
Output is correct |
4 |
Correct |
1 ms |
976 KB |
Output is correct |
5 |
Correct |
1 ms |
976 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
976 KB |
Output is correct |
8 |
Correct |
1 ms |
848 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
1104 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
1 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
2 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
1 ms |
848 KB |
Output is correct |
18 |
Correct |
1 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
848 KB |
Output is correct |
22 |
Correct |
1 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
864 KB |
Output is correct |
24 |
Correct |
1 ms |
1104 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
1 ms |
992 KB |
Output is correct |
27 |
Correct |
1 ms |
976 KB |
Output is correct |
28 |
Correct |
1 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
976 KB |
Output is correct |
32 |
Correct |
1 ms |
848 KB |
Output is correct |
33 |
Correct |
1 ms |
848 KB |
Output is correct |
34 |
Correct |
1 ms |
976 KB |
Output is correct |
35 |
Correct |
1 ms |
1104 KB |
Output is correct |
36 |
Correct |
26 ms |
22680 KB |
Output is correct |
37 |
Correct |
39 ms |
34828 KB |
Output is correct |
38 |
Correct |
40 ms |
34820 KB |
Output is correct |
39 |
Correct |
37 ms |
34560 KB |
Output is correct |
40 |
Correct |
38 ms |
34608 KB |
Output is correct |
41 |
Correct |
37 ms |
34608 KB |
Output is correct |
42 |
Correct |
42 ms |
34548 KB |
Output is correct |
43 |
Correct |
31 ms |
33976 KB |
Output is correct |
44 |
Correct |
31 ms |
33936 KB |
Output is correct |
45 |
Correct |
41 ms |
40736 KB |
Output is correct |
46 |
Correct |
43 ms |
40012 KB |
Output is correct |
47 |
Correct |
44 ms |
34840 KB |
Output is correct |
48 |
Correct |
41 ms |
34560 KB |
Output is correct |
49 |
Correct |
37 ms |
34564 KB |
Output is correct |
50 |
Correct |
31 ms |
33928 KB |
Output is correct |
51 |
Correct |
42 ms |
42836 KB |
Output is correct |
52 |
Correct |
40 ms |
34816 KB |
Output is correct |
53 |
Correct |
41 ms |
34552 KB |
Output is correct |
54 |
Correct |
38 ms |
34552 KB |
Output is correct |
55 |
Correct |
31 ms |
33952 KB |
Output is correct |
56 |
Correct |
43 ms |
42212 KB |
Output is correct |
57 |
Correct |
43 ms |
33588 KB |
Output is correct |
58 |
Correct |
40 ms |
34908 KB |
Output is correct |
59 |
Correct |
40 ms |
34820 KB |
Output is correct |
60 |
Correct |
42 ms |
34564 KB |
Output is correct |
61 |
Correct |
37 ms |
34560 KB |
Output is correct |
62 |
Correct |
37 ms |
34584 KB |
Output is correct |
63 |
Correct |
37 ms |
34584 KB |
Output is correct |
64 |
Correct |
36 ms |
34008 KB |
Output is correct |
65 |
Correct |
31 ms |
33952 KB |
Output is correct |
66 |
Correct |
40 ms |
39892 KB |
Output is correct |
67 |
Correct |
47 ms |
42464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
562 ms |
34532 KB |
Output is correct |
2 |
Correct |
689 ms |
34864 KB |
Output is correct |
3 |
Correct |
669 ms |
34912 KB |
Output is correct |
4 |
Correct |
675 ms |
34636 KB |
Output is correct |
5 |
Correct |
618 ms |
34564 KB |
Output is correct |
6 |
Correct |
897 ms |
34572 KB |
Output is correct |
7 |
Correct |
610 ms |
34608 KB |
Output is correct |
8 |
Correct |
663 ms |
33984 KB |
Output is correct |
9 |
Correct |
852 ms |
33908 KB |
Output is correct |
10 |
Correct |
899 ms |
40988 KB |
Output is correct |
11 |
Correct |
654 ms |
41028 KB |
Output is correct |
12 |
Correct |
787 ms |
33980 KB |
Output is correct |
13 |
Correct |
741 ms |
34080 KB |
Output is correct |
14 |
Correct |
0 ms |
208 KB |
Output is correct |
15 |
Correct |
1 ms |
848 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
39 ms |
34896 KB |
Output is correct |
18 |
Correct |
37 ms |
34608 KB |
Output is correct |
19 |
Correct |
37 ms |
34640 KB |
Output is correct |
20 |
Correct |
30 ms |
33932 KB |
Output is correct |
21 |
Correct |
48 ms |
42732 KB |
Output is correct |
22 |
Correct |
43 ms |
34880 KB |
Output is correct |
23 |
Correct |
42 ms |
34560 KB |
Output is correct |
24 |
Correct |
37 ms |
34556 KB |
Output is correct |
25 |
Correct |
31 ms |
33964 KB |
Output is correct |
26 |
Correct |
46 ms |
42204 KB |
Output is correct |
27 |
Correct |
1 ms |
976 KB |
Output is correct |
28 |
Correct |
1 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
964 KB |
Output is correct |
30 |
Correct |
1 ms |
848 KB |
Output is correct |
31 |
Correct |
1 ms |
976 KB |
Output is correct |
32 |
Correct |
1 ms |
976 KB |
Output is correct |
33 |
Correct |
1 ms |
848 KB |
Output is correct |
34 |
Correct |
1 ms |
848 KB |
Output is correct |
35 |
Correct |
1 ms |
848 KB |
Output is correct |
36 |
Correct |
1 ms |
1112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
240 ms |
8504 KB |
Output is correct |
2 |
Correct |
649 ms |
34816 KB |
Output is correct |
3 |
Correct |
755 ms |
34820 KB |
Output is correct |
4 |
Correct |
607 ms |
34636 KB |
Output is correct |
5 |
Correct |
685 ms |
34640 KB |
Output is correct |
6 |
Correct |
908 ms |
34584 KB |
Output is correct |
7 |
Correct |
576 ms |
34656 KB |
Output is correct |
8 |
Correct |
603 ms |
33940 KB |
Output is correct |
9 |
Correct |
723 ms |
33884 KB |
Output is correct |
10 |
Correct |
647 ms |
39748 KB |
Output is correct |
11 |
Correct |
891 ms |
40396 KB |
Output is correct |
12 |
Correct |
49 ms |
34912 KB |
Output is correct |
13 |
Correct |
44 ms |
34656 KB |
Output is correct |
14 |
Correct |
43 ms |
34656 KB |
Output is correct |
15 |
Correct |
37 ms |
33920 KB |
Output is correct |
16 |
Correct |
42 ms |
42272 KB |
Output is correct |
17 |
Correct |
38 ms |
33572 KB |
Output is correct |
18 |
Correct |
42 ms |
34836 KB |
Output is correct |
19 |
Correct |
40 ms |
34912 KB |
Output is correct |
20 |
Correct |
43 ms |
34564 KB |
Output is correct |
21 |
Correct |
37 ms |
34636 KB |
Output is correct |
22 |
Correct |
49 ms |
34580 KB |
Output is correct |
23 |
Correct |
42 ms |
34628 KB |
Output is correct |
24 |
Correct |
29 ms |
33928 KB |
Output is correct |
25 |
Correct |
37 ms |
33956 KB |
Output is correct |
26 |
Correct |
53 ms |
39840 KB |
Output is correct |
27 |
Correct |
50 ms |
42448 KB |
Output is correct |
28 |
Correct |
1 ms |
976 KB |
Output is correct |
29 |
Correct |
2 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
848 KB |
Output is correct |
32 |
Correct |
1 ms |
1104 KB |
Output is correct |
33 |
Correct |
1 ms |
592 KB |
Output is correct |
34 |
Correct |
1 ms |
976 KB |
Output is correct |
35 |
Correct |
1 ms |
996 KB |
Output is correct |
36 |
Correct |
1 ms |
1004 KB |
Output is correct |
37 |
Correct |
1 ms |
976 KB |
Output is correct |
38 |
Correct |
1 ms |
940 KB |
Output is correct |
39 |
Correct |
1 ms |
848 KB |
Output is correct |
40 |
Correct |
1 ms |
848 KB |
Output is correct |
41 |
Correct |
1 ms |
848 KB |
Output is correct |
42 |
Correct |
1 ms |
1104 KB |
Output is correct |
43 |
Correct |
2 ms |
1104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
976 KB |
Output is correct |
4 |
Correct |
1 ms |
976 KB |
Output is correct |
5 |
Correct |
1 ms |
976 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
976 KB |
Output is correct |
8 |
Correct |
1 ms |
848 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
1104 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
1 ms |
848 KB |
Output is correct |
14 |
Correct |
1 ms |
848 KB |
Output is correct |
15 |
Correct |
2 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
1 ms |
848 KB |
Output is correct |
18 |
Correct |
1 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
976 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
848 KB |
Output is correct |
22 |
Correct |
1 ms |
976 KB |
Output is correct |
23 |
Correct |
1 ms |
864 KB |
Output is correct |
24 |
Correct |
1 ms |
1104 KB |
Output is correct |
25 |
Correct |
1 ms |
592 KB |
Output is correct |
26 |
Correct |
1 ms |
992 KB |
Output is correct |
27 |
Correct |
1 ms |
976 KB |
Output is correct |
28 |
Correct |
1 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
976 KB |
Output is correct |
32 |
Correct |
1 ms |
848 KB |
Output is correct |
33 |
Correct |
1 ms |
848 KB |
Output is correct |
34 |
Correct |
1 ms |
976 KB |
Output is correct |
35 |
Correct |
1 ms |
1104 KB |
Output is correct |
36 |
Correct |
26 ms |
22680 KB |
Output is correct |
37 |
Correct |
39 ms |
34828 KB |
Output is correct |
38 |
Correct |
40 ms |
34820 KB |
Output is correct |
39 |
Correct |
37 ms |
34560 KB |
Output is correct |
40 |
Correct |
38 ms |
34608 KB |
Output is correct |
41 |
Correct |
37 ms |
34608 KB |
Output is correct |
42 |
Correct |
42 ms |
34548 KB |
Output is correct |
43 |
Correct |
31 ms |
33976 KB |
Output is correct |
44 |
Correct |
31 ms |
33936 KB |
Output is correct |
45 |
Correct |
41 ms |
40736 KB |
Output is correct |
46 |
Correct |
43 ms |
40012 KB |
Output is correct |
47 |
Correct |
44 ms |
34840 KB |
Output is correct |
48 |
Correct |
41 ms |
34560 KB |
Output is correct |
49 |
Correct |
37 ms |
34564 KB |
Output is correct |
50 |
Correct |
31 ms |
33928 KB |
Output is correct |
51 |
Correct |
42 ms |
42836 KB |
Output is correct |
52 |
Correct |
40 ms |
34816 KB |
Output is correct |
53 |
Correct |
41 ms |
34552 KB |
Output is correct |
54 |
Correct |
38 ms |
34552 KB |
Output is correct |
55 |
Correct |
31 ms |
33952 KB |
Output is correct |
56 |
Correct |
43 ms |
42212 KB |
Output is correct |
57 |
Correct |
43 ms |
33588 KB |
Output is correct |
58 |
Correct |
40 ms |
34908 KB |
Output is correct |
59 |
Correct |
40 ms |
34820 KB |
Output is correct |
60 |
Correct |
42 ms |
34564 KB |
Output is correct |
61 |
Correct |
37 ms |
34560 KB |
Output is correct |
62 |
Correct |
37 ms |
34584 KB |
Output is correct |
63 |
Correct |
37 ms |
34584 KB |
Output is correct |
64 |
Correct |
36 ms |
34008 KB |
Output is correct |
65 |
Correct |
31 ms |
33952 KB |
Output is correct |
66 |
Correct |
40 ms |
39892 KB |
Output is correct |
67 |
Correct |
47 ms |
42464 KB |
Output is correct |
68 |
Correct |
562 ms |
34532 KB |
Output is correct |
69 |
Correct |
689 ms |
34864 KB |
Output is correct |
70 |
Correct |
669 ms |
34912 KB |
Output is correct |
71 |
Correct |
675 ms |
34636 KB |
Output is correct |
72 |
Correct |
618 ms |
34564 KB |
Output is correct |
73 |
Correct |
897 ms |
34572 KB |
Output is correct |
74 |
Correct |
610 ms |
34608 KB |
Output is correct |
75 |
Correct |
663 ms |
33984 KB |
Output is correct |
76 |
Correct |
852 ms |
33908 KB |
Output is correct |
77 |
Correct |
899 ms |
40988 KB |
Output is correct |
78 |
Correct |
654 ms |
41028 KB |
Output is correct |
79 |
Correct |
787 ms |
33980 KB |
Output is correct |
80 |
Correct |
741 ms |
34080 KB |
Output is correct |
81 |
Correct |
0 ms |
208 KB |
Output is correct |
82 |
Correct |
1 ms |
848 KB |
Output is correct |
83 |
Correct |
1 ms |
848 KB |
Output is correct |
84 |
Correct |
39 ms |
34896 KB |
Output is correct |
85 |
Correct |
37 ms |
34608 KB |
Output is correct |
86 |
Correct |
37 ms |
34640 KB |
Output is correct |
87 |
Correct |
30 ms |
33932 KB |
Output is correct |
88 |
Correct |
48 ms |
42732 KB |
Output is correct |
89 |
Correct |
43 ms |
34880 KB |
Output is correct |
90 |
Correct |
42 ms |
34560 KB |
Output is correct |
91 |
Correct |
37 ms |
34556 KB |
Output is correct |
92 |
Correct |
31 ms |
33964 KB |
Output is correct |
93 |
Correct |
46 ms |
42204 KB |
Output is correct |
94 |
Correct |
1 ms |
976 KB |
Output is correct |
95 |
Correct |
1 ms |
848 KB |
Output is correct |
96 |
Correct |
1 ms |
964 KB |
Output is correct |
97 |
Correct |
1 ms |
848 KB |
Output is correct |
98 |
Correct |
1 ms |
976 KB |
Output is correct |
99 |
Correct |
1 ms |
976 KB |
Output is correct |
100 |
Correct |
1 ms |
848 KB |
Output is correct |
101 |
Correct |
1 ms |
848 KB |
Output is correct |
102 |
Correct |
1 ms |
848 KB |
Output is correct |
103 |
Correct |
1 ms |
1112 KB |
Output is correct |
104 |
Correct |
561 ms |
30828 KB |
Output is correct |
105 |
Correct |
666 ms |
34912 KB |
Output is correct |
106 |
Correct |
601 ms |
34916 KB |
Output is correct |
107 |
Correct |
819 ms |
34588 KB |
Output is correct |
108 |
Correct |
672 ms |
34552 KB |
Output is correct |
109 |
Correct |
835 ms |
34580 KB |
Output is correct |
110 |
Correct |
654 ms |
34648 KB |
Output is correct |
111 |
Correct |
715 ms |
33956 KB |
Output is correct |
112 |
Correct |
669 ms |
33940 KB |
Output is correct |
113 |
Correct |
662 ms |
41348 KB |
Output is correct |
114 |
Correct |
604 ms |
38740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
296 ms |
20344 KB |
Output is correct |
2 |
Correct |
646 ms |
33976 KB |
Output is correct |
3 |
Correct |
675 ms |
33956 KB |
Output is correct |
4 |
Correct |
793 ms |
33932 KB |
Output is correct |
5 |
Correct |
754 ms |
34012 KB |
Output is correct |
6 |
Correct |
623 ms |
33932 KB |
Output is correct |
7 |
Correct |
779 ms |
33948 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
848 KB |
Output is correct |
10 |
Correct |
1 ms |
848 KB |
Output is correct |
11 |
Correct |
0 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
976 KB |
Output is correct |
13 |
Correct |
1 ms |
976 KB |
Output is correct |
14 |
Correct |
1 ms |
976 KB |
Output is correct |
15 |
Correct |
1 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
848 KB |
Output is correct |
17 |
Correct |
1 ms |
976 KB |
Output is correct |
18 |
Correct |
1 ms |
848 KB |
Output is correct |
19 |
Correct |
1 ms |
848 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
1104 KB |
Output is correct |
22 |
Correct |
0 ms |
208 KB |
Output is correct |
23 |
Correct |
1 ms |
848 KB |
Output is correct |
24 |
Correct |
1 ms |
848 KB |
Output is correct |
25 |
Correct |
2 ms |
976 KB |
Output is correct |
26 |
Correct |
1 ms |
848 KB |
Output is correct |
27 |
Correct |
1 ms |
848 KB |
Output is correct |
28 |
Correct |
1 ms |
848 KB |
Output is correct |
29 |
Correct |
1 ms |
976 KB |
Output is correct |
30 |
Correct |
1 ms |
976 KB |
Output is correct |
31 |
Correct |
1 ms |
848 KB |
Output is correct |
32 |
Correct |
1 ms |
976 KB |
Output is correct |
33 |
Correct |
1 ms |
864 KB |
Output is correct |
34 |
Correct |
1 ms |
1104 KB |
Output is correct |
35 |
Correct |
1 ms |
592 KB |
Output is correct |
36 |
Correct |
1 ms |
992 KB |
Output is correct |
37 |
Correct |
1 ms |
976 KB |
Output is correct |
38 |
Correct |
1 ms |
848 KB |
Output is correct |
39 |
Correct |
1 ms |
976 KB |
Output is correct |
40 |
Correct |
1 ms |
976 KB |
Output is correct |
41 |
Correct |
1 ms |
976 KB |
Output is correct |
42 |
Correct |
1 ms |
848 KB |
Output is correct |
43 |
Correct |
1 ms |
848 KB |
Output is correct |
44 |
Correct |
1 ms |
976 KB |
Output is correct |
45 |
Correct |
1 ms |
1104 KB |
Output is correct |
46 |
Correct |
26 ms |
22680 KB |
Output is correct |
47 |
Correct |
39 ms |
34828 KB |
Output is correct |
48 |
Correct |
40 ms |
34820 KB |
Output is correct |
49 |
Correct |
37 ms |
34560 KB |
Output is correct |
50 |
Correct |
38 ms |
34608 KB |
Output is correct |
51 |
Correct |
37 ms |
34608 KB |
Output is correct |
52 |
Correct |
42 ms |
34548 KB |
Output is correct |
53 |
Correct |
31 ms |
33976 KB |
Output is correct |
54 |
Correct |
31 ms |
33936 KB |
Output is correct |
55 |
Correct |
41 ms |
40736 KB |
Output is correct |
56 |
Correct |
43 ms |
40012 KB |
Output is correct |
57 |
Correct |
44 ms |
34840 KB |
Output is correct |
58 |
Correct |
41 ms |
34560 KB |
Output is correct |
59 |
Correct |
37 ms |
34564 KB |
Output is correct |
60 |
Correct |
31 ms |
33928 KB |
Output is correct |
61 |
Correct |
42 ms |
42836 KB |
Output is correct |
62 |
Correct |
40 ms |
34816 KB |
Output is correct |
63 |
Correct |
41 ms |
34552 KB |
Output is correct |
64 |
Correct |
38 ms |
34552 KB |
Output is correct |
65 |
Correct |
31 ms |
33952 KB |
Output is correct |
66 |
Correct |
43 ms |
42212 KB |
Output is correct |
67 |
Correct |
43 ms |
33588 KB |
Output is correct |
68 |
Correct |
40 ms |
34908 KB |
Output is correct |
69 |
Correct |
40 ms |
34820 KB |
Output is correct |
70 |
Correct |
42 ms |
34564 KB |
Output is correct |
71 |
Correct |
37 ms |
34560 KB |
Output is correct |
72 |
Correct |
37 ms |
34584 KB |
Output is correct |
73 |
Correct |
37 ms |
34584 KB |
Output is correct |
74 |
Correct |
36 ms |
34008 KB |
Output is correct |
75 |
Correct |
31 ms |
33952 KB |
Output is correct |
76 |
Correct |
40 ms |
39892 KB |
Output is correct |
77 |
Correct |
47 ms |
42464 KB |
Output is correct |
78 |
Correct |
562 ms |
34532 KB |
Output is correct |
79 |
Correct |
689 ms |
34864 KB |
Output is correct |
80 |
Correct |
669 ms |
34912 KB |
Output is correct |
81 |
Correct |
675 ms |
34636 KB |
Output is correct |
82 |
Correct |
618 ms |
34564 KB |
Output is correct |
83 |
Correct |
897 ms |
34572 KB |
Output is correct |
84 |
Correct |
610 ms |
34608 KB |
Output is correct |
85 |
Correct |
663 ms |
33984 KB |
Output is correct |
86 |
Correct |
852 ms |
33908 KB |
Output is correct |
87 |
Correct |
899 ms |
40988 KB |
Output is correct |
88 |
Correct |
654 ms |
41028 KB |
Output is correct |
89 |
Correct |
787 ms |
33980 KB |
Output is correct |
90 |
Correct |
741 ms |
34080 KB |
Output is correct |
91 |
Correct |
0 ms |
208 KB |
Output is correct |
92 |
Correct |
1 ms |
848 KB |
Output is correct |
93 |
Correct |
1 ms |
848 KB |
Output is correct |
94 |
Correct |
39 ms |
34896 KB |
Output is correct |
95 |
Correct |
37 ms |
34608 KB |
Output is correct |
96 |
Correct |
37 ms |
34640 KB |
Output is correct |
97 |
Correct |
30 ms |
33932 KB |
Output is correct |
98 |
Correct |
48 ms |
42732 KB |
Output is correct |
99 |
Correct |
43 ms |
34880 KB |
Output is correct |
100 |
Correct |
42 ms |
34560 KB |
Output is correct |
101 |
Correct |
37 ms |
34556 KB |
Output is correct |
102 |
Correct |
31 ms |
33964 KB |
Output is correct |
103 |
Correct |
46 ms |
42204 KB |
Output is correct |
104 |
Correct |
1 ms |
976 KB |
Output is correct |
105 |
Correct |
1 ms |
848 KB |
Output is correct |
106 |
Correct |
1 ms |
964 KB |
Output is correct |
107 |
Correct |
1 ms |
848 KB |
Output is correct |
108 |
Correct |
1 ms |
976 KB |
Output is correct |
109 |
Correct |
1 ms |
976 KB |
Output is correct |
110 |
Correct |
1 ms |
848 KB |
Output is correct |
111 |
Correct |
1 ms |
848 KB |
Output is correct |
112 |
Correct |
1 ms |
848 KB |
Output is correct |
113 |
Correct |
1 ms |
1112 KB |
Output is correct |
114 |
Correct |
240 ms |
8504 KB |
Output is correct |
115 |
Correct |
649 ms |
34816 KB |
Output is correct |
116 |
Correct |
755 ms |
34820 KB |
Output is correct |
117 |
Correct |
607 ms |
34636 KB |
Output is correct |
118 |
Correct |
685 ms |
34640 KB |
Output is correct |
119 |
Correct |
908 ms |
34584 KB |
Output is correct |
120 |
Correct |
576 ms |
34656 KB |
Output is correct |
121 |
Correct |
603 ms |
33940 KB |
Output is correct |
122 |
Correct |
723 ms |
33884 KB |
Output is correct |
123 |
Correct |
647 ms |
39748 KB |
Output is correct |
124 |
Correct |
891 ms |
40396 KB |
Output is correct |
125 |
Correct |
49 ms |
34912 KB |
Output is correct |
126 |
Correct |
44 ms |
34656 KB |
Output is correct |
127 |
Correct |
43 ms |
34656 KB |
Output is correct |
128 |
Correct |
37 ms |
33920 KB |
Output is correct |
129 |
Correct |
42 ms |
42272 KB |
Output is correct |
130 |
Correct |
38 ms |
33572 KB |
Output is correct |
131 |
Correct |
42 ms |
34836 KB |
Output is correct |
132 |
Correct |
40 ms |
34912 KB |
Output is correct |
133 |
Correct |
43 ms |
34564 KB |
Output is correct |
134 |
Correct |
37 ms |
34636 KB |
Output is correct |
135 |
Correct |
49 ms |
34580 KB |
Output is correct |
136 |
Correct |
42 ms |
34628 KB |
Output is correct |
137 |
Correct |
29 ms |
33928 KB |
Output is correct |
138 |
Correct |
37 ms |
33956 KB |
Output is correct |
139 |
Correct |
53 ms |
39840 KB |
Output is correct |
140 |
Correct |
50 ms |
42448 KB |
Output is correct |
141 |
Correct |
1 ms |
976 KB |
Output is correct |
142 |
Correct |
2 ms |
976 KB |
Output is correct |
143 |
Correct |
1 ms |
976 KB |
Output is correct |
144 |
Correct |
1 ms |
848 KB |
Output is correct |
145 |
Correct |
1 ms |
1104 KB |
Output is correct |
146 |
Correct |
1 ms |
592 KB |
Output is correct |
147 |
Correct |
1 ms |
976 KB |
Output is correct |
148 |
Correct |
1 ms |
996 KB |
Output is correct |
149 |
Correct |
1 ms |
1004 KB |
Output is correct |
150 |
Correct |
1 ms |
976 KB |
Output is correct |
151 |
Correct |
1 ms |
940 KB |
Output is correct |
152 |
Correct |
1 ms |
848 KB |
Output is correct |
153 |
Correct |
1 ms |
848 KB |
Output is correct |
154 |
Correct |
1 ms |
848 KB |
Output is correct |
155 |
Correct |
1 ms |
1104 KB |
Output is correct |
156 |
Correct |
2 ms |
1104 KB |
Output is correct |
157 |
Correct |
561 ms |
30828 KB |
Output is correct |
158 |
Correct |
666 ms |
34912 KB |
Output is correct |
159 |
Correct |
601 ms |
34916 KB |
Output is correct |
160 |
Correct |
819 ms |
34588 KB |
Output is correct |
161 |
Correct |
672 ms |
34552 KB |
Output is correct |
162 |
Correct |
835 ms |
34580 KB |
Output is correct |
163 |
Correct |
654 ms |
34648 KB |
Output is correct |
164 |
Correct |
715 ms |
33956 KB |
Output is correct |
165 |
Correct |
669 ms |
33940 KB |
Output is correct |
166 |
Correct |
662 ms |
41348 KB |
Output is correct |
167 |
Correct |
604 ms |
38740 KB |
Output is correct |
168 |
Correct |
0 ms |
208 KB |
Output is correct |
169 |
Incorrect |
509 ms |
12256 KB |
2nd lines differ - on the 1st token, expected: '128', found: '1528' |
170 |
Halted |
0 ms |
0 KB |
- |