#include "pyramids.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define cmin(a, b) a = min(a, b)
#define cmax(a, b) a = max(a, b)
vector<long long> pref1, pref2;
void init(vector<int> a, vector<int> b) {
pref1.pb(a[0]), pref2.pb(b[0]);
for (int i=1; i<sz(a); i++) {
pref1.pb(pref1.back()+a[i]);
pref2.pb(pref2.back()+b[i]);
}
}
bool can_transform(int l, int r, int x, int y) {
long long sum1=pref1[r]-(l?pref1[l-1]:0), sum2=pref2[y]-(x?pref2[x-1]:0);
return sum1==sum2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
336 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
1 ms |
336 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
508 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
336 KB |
Output is correct |
27 |
Correct |
1 ms |
336 KB |
Output is correct |
28 |
Correct |
1 ms |
336 KB |
Output is correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Correct |
1 ms |
336 KB |
Output is correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
33 |
Correct |
1 ms |
336 KB |
Output is correct |
34 |
Correct |
1 ms |
336 KB |
Output is correct |
35 |
Correct |
1 ms |
336 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
336 KB |
Output is correct |
38 |
Correct |
1 ms |
336 KB |
Output is correct |
39 |
Correct |
2 ms |
336 KB |
Output is correct |
40 |
Correct |
2 ms |
336 KB |
Output is correct |
41 |
Correct |
1 ms |
336 KB |
Output is correct |
42 |
Correct |
1 ms |
336 KB |
Output is correct |
43 |
Correct |
1 ms |
336 KB |
Output is correct |
44 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
7452 KB |
Output is correct |
2 |
Correct |
43 ms |
7612 KB |
Output is correct |
3 |
Correct |
44 ms |
7612 KB |
Output is correct |
4 |
Correct |
46 ms |
7876 KB |
Output is correct |
5 |
Correct |
46 ms |
7868 KB |
Output is correct |
6 |
Correct |
45 ms |
7868 KB |
Output is correct |
7 |
Correct |
41 ms |
7868 KB |
Output is correct |
8 |
Correct |
41 ms |
7868 KB |
Output is correct |
9 |
Correct |
41 ms |
7852 KB |
Output is correct |
10 |
Correct |
45 ms |
7876 KB |
Output is correct |
11 |
Correct |
49 ms |
7868 KB |
Output is correct |
12 |
Correct |
44 ms |
7868 KB |
Output is correct |
13 |
Correct |
55 ms |
8000 KB |
Output is correct |
14 |
Correct |
45 ms |
7848 KB |
Output is correct |
15 |
Correct |
43 ms |
7928 KB |
Output is correct |
16 |
Correct |
45 ms |
7868 KB |
Output is correct |
17 |
Correct |
45 ms |
7624 KB |
Output is correct |
18 |
Correct |
37 ms |
7408 KB |
Output is correct |
19 |
Correct |
37 ms |
7492 KB |
Output is correct |
20 |
Correct |
46 ms |
7624 KB |
Output is correct |
21 |
Correct |
38 ms |
7604 KB |
Output is correct |
22 |
Correct |
37 ms |
6588 KB |
Output is correct |
23 |
Correct |
38 ms |
7360 KB |
Output is correct |
24 |
Correct |
37 ms |
6588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
336 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
1 ms |
336 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
508 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
336 KB |
Output is correct |
27 |
Correct |
1 ms |
336 KB |
Output is correct |
28 |
Correct |
1 ms |
336 KB |
Output is correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Correct |
1 ms |
336 KB |
Output is correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
33 |
Correct |
1 ms |
336 KB |
Output is correct |
34 |
Correct |
1 ms |
336 KB |
Output is correct |
35 |
Correct |
1 ms |
336 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
336 KB |
Output is correct |
38 |
Correct |
1 ms |
336 KB |
Output is correct |
39 |
Correct |
2 ms |
336 KB |
Output is correct |
40 |
Correct |
2 ms |
336 KB |
Output is correct |
41 |
Correct |
1 ms |
336 KB |
Output is correct |
42 |
Correct |
1 ms |
336 KB |
Output is correct |
43 |
Correct |
1 ms |
336 KB |
Output is correct |
44 |
Correct |
1 ms |
336 KB |
Output is correct |
45 |
Correct |
46 ms |
7452 KB |
Output is correct |
46 |
Correct |
43 ms |
7612 KB |
Output is correct |
47 |
Correct |
44 ms |
7612 KB |
Output is correct |
48 |
Correct |
46 ms |
7876 KB |
Output is correct |
49 |
Correct |
46 ms |
7868 KB |
Output is correct |
50 |
Correct |
45 ms |
7868 KB |
Output is correct |
51 |
Correct |
41 ms |
7868 KB |
Output is correct |
52 |
Correct |
41 ms |
7868 KB |
Output is correct |
53 |
Correct |
41 ms |
7852 KB |
Output is correct |
54 |
Correct |
45 ms |
7876 KB |
Output is correct |
55 |
Correct |
49 ms |
7868 KB |
Output is correct |
56 |
Correct |
44 ms |
7868 KB |
Output is correct |
57 |
Correct |
55 ms |
8000 KB |
Output is correct |
58 |
Correct |
45 ms |
7848 KB |
Output is correct |
59 |
Correct |
43 ms |
7928 KB |
Output is correct |
60 |
Correct |
45 ms |
7868 KB |
Output is correct |
61 |
Correct |
45 ms |
7624 KB |
Output is correct |
62 |
Correct |
37 ms |
7408 KB |
Output is correct |
63 |
Correct |
37 ms |
7492 KB |
Output is correct |
64 |
Correct |
46 ms |
7624 KB |
Output is correct |
65 |
Correct |
38 ms |
7604 KB |
Output is correct |
66 |
Correct |
37 ms |
6588 KB |
Output is correct |
67 |
Correct |
38 ms |
7360 KB |
Output is correct |
68 |
Correct |
37 ms |
6588 KB |
Output is correct |
69 |
Correct |
54 ms |
8892 KB |
Output is correct |
70 |
Correct |
47 ms |
8212 KB |
Output is correct |
71 |
Correct |
62 ms |
8736 KB |
Output is correct |
72 |
Correct |
52 ms |
8892 KB |
Output is correct |
73 |
Correct |
48 ms |
7252 KB |
Output is correct |
74 |
Correct |
48 ms |
8552 KB |
Output is correct |
75 |
Correct |
51 ms |
7612 KB |
Output is correct |
76 |
Correct |
43 ms |
7868 KB |
Output is correct |
77 |
Correct |
46 ms |
7868 KB |
Output is correct |
78 |
Correct |
8 ms |
1104 KB |
Output is correct |
79 |
Correct |
6 ms |
1104 KB |
Output is correct |
80 |
Correct |
5 ms |
1104 KB |
Output is correct |
81 |
Correct |
52 ms |
9404 KB |
Output is correct |
82 |
Correct |
52 ms |
9548 KB |
Output is correct |
83 |
Correct |
49 ms |
7576 KB |
Output is correct |
84 |
Correct |
52 ms |
9380 KB |
Output is correct |
85 |
Correct |
53 ms |
9540 KB |
Output is correct |