#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 |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
11 ms |
604 KB |
Output is correct |
8 |
Correct |
11 ms |
636 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 |
504 KB |
Output is correct |
13 |
Correct |
9 ms |
604 KB |
Output is correct |
14 |
Correct |
9 ms |
604 KB |
Output is correct |
15 |
Correct |
12 ms |
608 KB |
Output is correct |
16 |
Correct |
9 ms |
348 KB |
Output is correct |
17 |
Correct |
12 ms |
348 KB |
Output is correct |
18 |
Correct |
7 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1634 ms |
3260 KB |
Output is correct |
2 |
Correct |
1626 ms |
3276 KB |
Output is correct |
3 |
Correct |
1640 ms |
3240 KB |
Output is correct |
4 |
Correct |
1531 ms |
3064 KB |
Output is correct |
5 |
Correct |
1465 ms |
3248 KB |
Output is correct |
6 |
Correct |
1438 ms |
3016 KB |
Output is correct |
7 |
Correct |
1520 ms |
3224 KB |
Output is correct |
8 |
Correct |
1555 ms |
3296 KB |
Output is correct |
9 |
Correct |
1462 ms |
3468 KB |
Output is correct |
10 |
Correct |
1470 ms |
2644 KB |
Output is correct |
11 |
Correct |
1463 ms |
2584 KB |
Output is correct |
12 |
Correct |
1431 ms |
2328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1634 ms |
3260 KB |
Output is correct |
2 |
Correct |
1626 ms |
3276 KB |
Output is correct |
3 |
Correct |
1640 ms |
3240 KB |
Output is correct |
4 |
Correct |
1531 ms |
3064 KB |
Output is correct |
5 |
Correct |
1465 ms |
3248 KB |
Output is correct |
6 |
Correct |
1438 ms |
3016 KB |
Output is correct |
7 |
Correct |
1520 ms |
3224 KB |
Output is correct |
8 |
Correct |
1555 ms |
3296 KB |
Output is correct |
9 |
Correct |
1462 ms |
3468 KB |
Output is correct |
10 |
Correct |
1470 ms |
2644 KB |
Output is correct |
11 |
Correct |
1463 ms |
2584 KB |
Output is correct |
12 |
Correct |
1431 ms |
2328 KB |
Output is correct |
13 |
Correct |
1523 ms |
3624 KB |
Output is correct |
14 |
Correct |
1520 ms |
3416 KB |
Output is correct |
15 |
Correct |
1547 ms |
3476 KB |
Output is correct |
16 |
Correct |
1560 ms |
2896 KB |
Output is correct |
17 |
Correct |
1528 ms |
3304 KB |
Output is correct |
18 |
Correct |
1526 ms |
2544 KB |
Output is correct |
19 |
Correct |
1620 ms |
3508 KB |
Output is correct |
20 |
Correct |
1571 ms |
3352 KB |
Output is correct |
21 |
Correct |
1576 ms |
3544 KB |
Output is correct |
22 |
Correct |
1632 ms |
2708 KB |
Output is correct |
23 |
Correct |
1521 ms |
2708 KB |
Output is correct |
24 |
Correct |
1547 ms |
2300 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 |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
11 ms |
604 KB |
Output is correct |
8 |
Correct |
11 ms |
636 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 |
504 KB |
Output is correct |
13 |
Correct |
9 ms |
604 KB |
Output is correct |
14 |
Correct |
9 ms |
604 KB |
Output is correct |
15 |
Correct |
12 ms |
608 KB |
Output is correct |
16 |
Correct |
9 ms |
348 KB |
Output is correct |
17 |
Correct |
12 ms |
348 KB |
Output is correct |
18 |
Correct |
7 ms |
460 KB |
Output is correct |
19 |
Correct |
1634 ms |
3260 KB |
Output is correct |
20 |
Correct |
1626 ms |
3276 KB |
Output is correct |
21 |
Correct |
1640 ms |
3240 KB |
Output is correct |
22 |
Correct |
1531 ms |
3064 KB |
Output is correct |
23 |
Correct |
1465 ms |
3248 KB |
Output is correct |
24 |
Correct |
1438 ms |
3016 KB |
Output is correct |
25 |
Correct |
1520 ms |
3224 KB |
Output is correct |
26 |
Correct |
1555 ms |
3296 KB |
Output is correct |
27 |
Correct |
1462 ms |
3468 KB |
Output is correct |
28 |
Correct |
1470 ms |
2644 KB |
Output is correct |
29 |
Correct |
1463 ms |
2584 KB |
Output is correct |
30 |
Correct |
1431 ms |
2328 KB |
Output is correct |
31 |
Correct |
1523 ms |
3624 KB |
Output is correct |
32 |
Correct |
1520 ms |
3416 KB |
Output is correct |
33 |
Correct |
1547 ms |
3476 KB |
Output is correct |
34 |
Correct |
1560 ms |
2896 KB |
Output is correct |
35 |
Correct |
1528 ms |
3304 KB |
Output is correct |
36 |
Correct |
1526 ms |
2544 KB |
Output is correct |
37 |
Correct |
1620 ms |
3508 KB |
Output is correct |
38 |
Correct |
1571 ms |
3352 KB |
Output is correct |
39 |
Correct |
1576 ms |
3544 KB |
Output is correct |
40 |
Correct |
1632 ms |
2708 KB |
Output is correct |
41 |
Correct |
1521 ms |
2708 KB |
Output is correct |
42 |
Correct |
1547 ms |
2300 KB |
Output is correct |
43 |
Correct |
1544 ms |
4800 KB |
Output is correct |
44 |
Correct |
1591 ms |
4780 KB |
Output is correct |
45 |
Correct |
1570 ms |
4840 KB |
Output is correct |
46 |
Correct |
1535 ms |
3452 KB |
Output is correct |
47 |
Correct |
1507 ms |
3524 KB |
Output is correct |
48 |
Correct |
1513 ms |
2128 KB |
Output is correct |
49 |
Correct |
1548 ms |
4648 KB |
Output is correct |
50 |
Correct |
1565 ms |
4296 KB |
Output is correct |
51 |
Correct |
1573 ms |
4600 KB |
Output is correct |
52 |
Correct |
1520 ms |
3756 KB |
Output is correct |
53 |
Correct |
1525 ms |
3408 KB |
Output is correct |