# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127121 | 2019-07-08T23:57:55 Z | arnold518 | None (KOI18_XCorr) | C++14 | 184 ms | 18524 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 3e5; int N, M; ll A[MAXN+10], X[MAXN+10], B[MAXN+10], Y[MAXN+10], a, b, ans; int main() { int i, j; scanf("%d", &N); for(i=1; i<=N; i++) scanf("%lld%lld", &A[i], &X[i]); scanf("%d", &M); B[0]=-1e10; Y[0]=0; for(i=1; i<=M; i++) scanf("%lld%lld", &B[i], &Y[i]), Y[i]+=Y[i-1]; scanf("%lld%lld", &a, &b); for(i=1; i<=N; i++) { ans+=X[i]*(Y[upper_bound(B, B+M+1, A[i]+b)-B-1]-Y[lower_bound(B, B+M+1, A[i]+a)-B-1]); } printf("%lld", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 504 KB | Output is correct |
2 | Correct | 3 ms | 504 KB | Output is correct |
3 | Correct | 3 ms | 504 KB | Output is correct |
4 | Correct | 3 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 3 ms | 504 KB | Output is correct |
7 | Correct | 3 ms | 504 KB | Output is correct |
8 | Correct | 3 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 3 ms | 504 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 3 ms | 504 KB | Output is correct |
13 | Correct | 3 ms | 504 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 3 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 504 KB | Output is correct |
2 | Correct | 3 ms | 504 KB | Output is correct |
3 | Correct | 3 ms | 504 KB | Output is correct |
4 | Correct | 3 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 3 ms | 504 KB | Output is correct |
7 | Correct | 3 ms | 504 KB | Output is correct |
8 | Correct | 3 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 3 ms | 504 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 3 ms | 504 KB | Output is correct |
13 | Correct | 3 ms | 504 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 3 ms | 376 KB | Output is correct |
16 | Correct | 92 ms | 9340 KB | Output is correct |
17 | Correct | 3 ms | 540 KB | Output is correct |
18 | Correct | 160 ms | 16384 KB | Output is correct |
19 | Correct | 3 ms | 504 KB | Output is correct |
20 | Correct | 3 ms | 504 KB | Output is correct |
21 | Correct | 3 ms | 380 KB | Output is correct |
22 | Correct | 2 ms | 376 KB | Output is correct |
23 | Correct | 3 ms | 504 KB | Output is correct |
24 | Correct | 160 ms | 15124 KB | Output is correct |
25 | Correct | 150 ms | 16480 KB | Output is correct |
26 | Correct | 156 ms | 16300 KB | Output is correct |
27 | Correct | 4 ms | 504 KB | Output is correct |
28 | Correct | 4 ms | 504 KB | Output is correct |
29 | Correct | 2 ms | 376 KB | Output is correct |
30 | Correct | 152 ms | 16428 KB | Output is correct |
31 | Correct | 4 ms | 632 KB | Output is correct |
32 | Correct | 158 ms | 15632 KB | Output is correct |
33 | Correct | 153 ms | 16248 KB | Output is correct |
34 | Correct | 77 ms | 7816 KB | Output is correct |
35 | Correct | 2 ms | 376 KB | Output is correct |
36 | Correct | 163 ms | 16400 KB | Output is correct |
37 | Correct | 52 ms | 5496 KB | Output is correct |
38 | Correct | 3 ms | 504 KB | Output is correct |
39 | Correct | 148 ms | 15352 KB | Output is correct |
40 | Correct | 3 ms | 504 KB | Output is correct |
41 | Correct | 2 ms | 376 KB | Output is correct |
42 | Correct | 3 ms | 376 KB | Output is correct |
43 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 504 KB | Output is correct |
2 | Correct | 3 ms | 504 KB | Output is correct |
3 | Correct | 3 ms | 504 KB | Output is correct |
4 | Correct | 3 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 3 ms | 504 KB | Output is correct |
7 | Correct | 3 ms | 504 KB | Output is correct |
8 | Correct | 3 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 3 ms | 504 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 3 ms | 504 KB | Output is correct |
13 | Correct | 3 ms | 504 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 3 ms | 376 KB | Output is correct |
16 | Correct | 92 ms | 9340 KB | Output is correct |
17 | Correct | 3 ms | 540 KB | Output is correct |
18 | Correct | 160 ms | 16384 KB | Output is correct |
19 | Correct | 3 ms | 504 KB | Output is correct |
20 | Correct | 3 ms | 504 KB | Output is correct |
21 | Correct | 3 ms | 380 KB | Output is correct |
22 | Correct | 2 ms | 376 KB | Output is correct |
23 | Correct | 3 ms | 504 KB | Output is correct |
24 | Correct | 160 ms | 15124 KB | Output is correct |
25 | Correct | 150 ms | 16480 KB | Output is correct |
26 | Correct | 156 ms | 16300 KB | Output is correct |
27 | Correct | 4 ms | 504 KB | Output is correct |
28 | Correct | 4 ms | 504 KB | Output is correct |
29 | Correct | 2 ms | 376 KB | Output is correct |
30 | Correct | 152 ms | 16428 KB | Output is correct |
31 | Correct | 4 ms | 632 KB | Output is correct |
32 | Correct | 158 ms | 15632 KB | Output is correct |
33 | Correct | 153 ms | 16248 KB | Output is correct |
34 | Correct | 77 ms | 7816 KB | Output is correct |
35 | Correct | 2 ms | 376 KB | Output is correct |
36 | Correct | 163 ms | 16400 KB | Output is correct |
37 | Correct | 52 ms | 5496 KB | Output is correct |
38 | Correct | 3 ms | 504 KB | Output is correct |
39 | Correct | 148 ms | 15352 KB | Output is correct |
40 | Correct | 3 ms | 504 KB | Output is correct |
41 | Correct | 2 ms | 376 KB | Output is correct |
42 | Correct | 3 ms | 376 KB | Output is correct |
43 | Correct | 2 ms | 376 KB | Output is correct |
44 | Correct | 92 ms | 9336 KB | Output is correct |
45 | Correct | 3 ms | 504 KB | Output is correct |
46 | Correct | 168 ms | 16376 KB | Output is correct |
47 | Correct | 4 ms | 504 KB | Output is correct |
48 | Correct | 134 ms | 13176 KB | Output is correct |
49 | Correct | 59 ms | 6452 KB | Output is correct |
50 | Correct | 3 ms | 504 KB | Output is correct |
51 | Correct | 3 ms | 376 KB | Output is correct |
52 | Correct | 2 ms | 376 KB | Output is correct |
53 | Correct | 4 ms | 504 KB | Output is correct |
54 | Correct | 182 ms | 15012 KB | Output is correct |
55 | Correct | 145 ms | 16500 KB | Output is correct |
56 | Correct | 159 ms | 18524 KB | Output is correct |
57 | Correct | 158 ms | 16244 KB | Output is correct |
58 | Correct | 179 ms | 18200 KB | Output is correct |
59 | Correct | 3 ms | 504 KB | Output is correct |
60 | Correct | 2 ms | 376 KB | Output is correct |
61 | Correct | 3 ms | 504 KB | Output is correct |
62 | Correct | 173 ms | 18172 KB | Output is correct |
63 | Correct | 183 ms | 18228 KB | Output is correct |
64 | Correct | 2 ms | 376 KB | Output is correct |
65 | Correct | 173 ms | 18216 KB | Output is correct |
66 | Correct | 151 ms | 16348 KB | Output is correct |
67 | Correct | 184 ms | 17508 KB | Output is correct |
68 | Correct | 3 ms | 440 KB | Output is correct |
69 | Correct | 159 ms | 15752 KB | Output is correct |
70 | Correct | 82 ms | 8360 KB | Output is correct |
71 | Correct | 175 ms | 17876 KB | Output is correct |
72 | Correct | 151 ms | 16376 KB | Output is correct |
73 | Correct | 68 ms | 7800 KB | Output is correct |
74 | Correct | 2 ms | 376 KB | Output is correct |
75 | Correct | 160 ms | 16524 KB | Output is correct |
76 | Correct | 53 ms | 5496 KB | Output is correct |
77 | Correct | 3 ms | 504 KB | Output is correct |
78 | Correct | 147 ms | 15352 KB | Output is correct |
79 | Correct | 2 ms | 376 KB | Output is correct |
80 | Correct | 4 ms | 504 KB | Output is correct |
81 | Correct | 2 ms | 376 KB | Output is correct |
82 | Correct | 183 ms | 18252 KB | Output is correct |
83 | Correct | 2 ms | 376 KB | Output is correct |
84 | Correct | 2 ms | 376 KB | Output is correct |
85 | Correct | 179 ms | 17656 KB | Output is correct |