#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int x[100001], y[100001];
int main() {
int n, q;
cin >> n >> q;
for (int i = 0; i < n; i++) {
cin >> x[i] >> y[i];
}
for (int i = 0; i < q; i++) {
int ans = 0;
int a, b, c;
cin >> a >> b >> c;
for (int j = 0; j < n; j++) {
if (x[j] >= a && y[j] >= b && x[j] + y[j] >= c) ans++;
}
cout << ans << '\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
604 KB |
Output is correct |
8 |
Correct |
9 ms |
604 KB |
Output is correct |
9 |
Correct |
9 ms |
604 KB |
Output is correct |
10 |
Correct |
8 ms |
348 KB |
Output is correct |
11 |
Correct |
8 ms |
348 KB |
Output is correct |
12 |
Correct |
7 ms |
348 KB |
Output is correct |
13 |
Correct |
9 ms |
604 KB |
Output is correct |
14 |
Correct |
9 ms |
604 KB |
Output is correct |
15 |
Correct |
9 ms |
604 KB |
Output is correct |
16 |
Correct |
10 ms |
604 KB |
Output is correct |
17 |
Correct |
8 ms |
348 KB |
Output is correct |
18 |
Correct |
7 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1512 ms |
4564 KB |
Output is correct |
2 |
Correct |
1489 ms |
4176 KB |
Output is correct |
3 |
Correct |
1524 ms |
4732 KB |
Output is correct |
4 |
Correct |
1501 ms |
3288 KB |
Output is correct |
5 |
Correct |
1524 ms |
3532 KB |
Output is correct |
6 |
Correct |
1461 ms |
3012 KB |
Output is correct |
7 |
Correct |
1469 ms |
4088 KB |
Output is correct |
8 |
Correct |
1504 ms |
4624 KB |
Output is correct |
9 |
Correct |
1503 ms |
4056 KB |
Output is correct |
10 |
Correct |
1510 ms |
3432 KB |
Output is correct |
11 |
Correct |
1449 ms |
3692 KB |
Output is correct |
12 |
Correct |
1453 ms |
2552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1512 ms |
4564 KB |
Output is correct |
2 |
Correct |
1489 ms |
4176 KB |
Output is correct |
3 |
Correct |
1524 ms |
4732 KB |
Output is correct |
4 |
Correct |
1501 ms |
3288 KB |
Output is correct |
5 |
Correct |
1524 ms |
3532 KB |
Output is correct |
6 |
Correct |
1461 ms |
3012 KB |
Output is correct |
7 |
Correct |
1469 ms |
4088 KB |
Output is correct |
8 |
Correct |
1504 ms |
4624 KB |
Output is correct |
9 |
Correct |
1503 ms |
4056 KB |
Output is correct |
10 |
Correct |
1510 ms |
3432 KB |
Output is correct |
11 |
Correct |
1449 ms |
3692 KB |
Output is correct |
12 |
Correct |
1453 ms |
2552 KB |
Output is correct |
13 |
Correct |
1506 ms |
4696 KB |
Output is correct |
14 |
Correct |
1522 ms |
4948 KB |
Output is correct |
15 |
Correct |
1493 ms |
4180 KB |
Output is correct |
16 |
Correct |
1504 ms |
3752 KB |
Output is correct |
17 |
Correct |
1491 ms |
4032 KB |
Output is correct |
18 |
Correct |
1506 ms |
2808 KB |
Output is correct |
19 |
Correct |
1521 ms |
4692 KB |
Output is correct |
20 |
Correct |
1539 ms |
4988 KB |
Output is correct |
21 |
Correct |
1470 ms |
4692 KB |
Output is correct |
22 |
Correct |
1460 ms |
3448 KB |
Output is correct |
23 |
Correct |
1531 ms |
3424 KB |
Output is correct |
24 |
Correct |
1475 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
604 KB |
Output is correct |
8 |
Correct |
9 ms |
604 KB |
Output is correct |
9 |
Correct |
9 ms |
604 KB |
Output is correct |
10 |
Correct |
8 ms |
348 KB |
Output is correct |
11 |
Correct |
8 ms |
348 KB |
Output is correct |
12 |
Correct |
7 ms |
348 KB |
Output is correct |
13 |
Correct |
9 ms |
604 KB |
Output is correct |
14 |
Correct |
9 ms |
604 KB |
Output is correct |
15 |
Correct |
9 ms |
604 KB |
Output is correct |
16 |
Correct |
10 ms |
604 KB |
Output is correct |
17 |
Correct |
8 ms |
348 KB |
Output is correct |
18 |
Correct |
7 ms |
348 KB |
Output is correct |
19 |
Correct |
1512 ms |
4564 KB |
Output is correct |
20 |
Correct |
1489 ms |
4176 KB |
Output is correct |
21 |
Correct |
1524 ms |
4732 KB |
Output is correct |
22 |
Correct |
1501 ms |
3288 KB |
Output is correct |
23 |
Correct |
1524 ms |
3532 KB |
Output is correct |
24 |
Correct |
1461 ms |
3012 KB |
Output is correct |
25 |
Correct |
1469 ms |
4088 KB |
Output is correct |
26 |
Correct |
1504 ms |
4624 KB |
Output is correct |
27 |
Correct |
1503 ms |
4056 KB |
Output is correct |
28 |
Correct |
1510 ms |
3432 KB |
Output is correct |
29 |
Correct |
1449 ms |
3692 KB |
Output is correct |
30 |
Correct |
1453 ms |
2552 KB |
Output is correct |
31 |
Correct |
1506 ms |
4696 KB |
Output is correct |
32 |
Correct |
1522 ms |
4948 KB |
Output is correct |
33 |
Correct |
1493 ms |
4180 KB |
Output is correct |
34 |
Correct |
1504 ms |
3752 KB |
Output is correct |
35 |
Correct |
1491 ms |
4032 KB |
Output is correct |
36 |
Correct |
1506 ms |
2808 KB |
Output is correct |
37 |
Correct |
1521 ms |
4692 KB |
Output is correct |
38 |
Correct |
1539 ms |
4988 KB |
Output is correct |
39 |
Correct |
1470 ms |
4692 KB |
Output is correct |
40 |
Correct |
1460 ms |
3448 KB |
Output is correct |
41 |
Correct |
1531 ms |
3424 KB |
Output is correct |
42 |
Correct |
1475 ms |
2652 KB |
Output is correct |
43 |
Correct |
1556 ms |
6920 KB |
Output is correct |
44 |
Correct |
1556 ms |
6888 KB |
Output is correct |
45 |
Correct |
1619 ms |
6600 KB |
Output is correct |
46 |
Correct |
1532 ms |
4956 KB |
Output is correct |
47 |
Correct |
1528 ms |
5336 KB |
Output is correct |
48 |
Correct |
1427 ms |
2656 KB |
Output is correct |
49 |
Correct |
1557 ms |
6740 KB |
Output is correct |
50 |
Correct |
1604 ms |
6740 KB |
Output is correct |
51 |
Correct |
1547 ms |
6272 KB |
Output is correct |
52 |
Correct |
1528 ms |
4844 KB |
Output is correct |
53 |
Correct |
1487 ms |
4324 KB |
Output is correct |