#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';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
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 |
348 KB |
Output is correct |
8 |
Correct |
13 ms |
348 KB |
Output is correct |
9 |
Correct |
12 ms |
344 KB |
Output is correct |
10 |
Correct |
9 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 |
348 KB |
Output is correct |
14 |
Correct |
9 ms |
348 KB |
Output is correct |
15 |
Correct |
8 ms |
348 KB |
Output is correct |
16 |
Correct |
8 ms |
600 KB |
Output is correct |
17 |
Correct |
8 ms |
348 KB |
Output is correct |
18 |
Correct |
10 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1545 ms |
2856 KB |
Output is correct |
2 |
Correct |
1623 ms |
4144 KB |
Output is correct |
3 |
Correct |
1557 ms |
4092 KB |
Output is correct |
4 |
Correct |
1536 ms |
3772 KB |
Output is correct |
5 |
Correct |
1620 ms |
3280 KB |
Output is correct |
6 |
Correct |
1466 ms |
3128 KB |
Output is correct |
7 |
Correct |
1565 ms |
4564 KB |
Output is correct |
8 |
Correct |
1601 ms |
4168 KB |
Output is correct |
9 |
Correct |
1542 ms |
4100 KB |
Output is correct |
10 |
Correct |
1544 ms |
3312 KB |
Output is correct |
11 |
Correct |
1537 ms |
3472 KB |
Output is correct |
12 |
Correct |
1487 ms |
2320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1545 ms |
2856 KB |
Output is correct |
2 |
Correct |
1623 ms |
4144 KB |
Output is correct |
3 |
Correct |
1557 ms |
4092 KB |
Output is correct |
4 |
Correct |
1536 ms |
3772 KB |
Output is correct |
5 |
Correct |
1620 ms |
3280 KB |
Output is correct |
6 |
Correct |
1466 ms |
3128 KB |
Output is correct |
7 |
Correct |
1565 ms |
4564 KB |
Output is correct |
8 |
Correct |
1601 ms |
4168 KB |
Output is correct |
9 |
Correct |
1542 ms |
4100 KB |
Output is correct |
10 |
Correct |
1544 ms |
3312 KB |
Output is correct |
11 |
Correct |
1537 ms |
3472 KB |
Output is correct |
12 |
Correct |
1487 ms |
2320 KB |
Output is correct |
13 |
Correct |
1543 ms |
4644 KB |
Output is correct |
14 |
Correct |
1554 ms |
4592 KB |
Output is correct |
15 |
Correct |
1531 ms |
4264 KB |
Output is correct |
16 |
Correct |
1455 ms |
3744 KB |
Output is correct |
17 |
Correct |
1515 ms |
3900 KB |
Output is correct |
18 |
Correct |
1544 ms |
2808 KB |
Output is correct |
19 |
Correct |
1578 ms |
4688 KB |
Output is correct |
20 |
Correct |
1575 ms |
4664 KB |
Output is correct |
21 |
Correct |
1582 ms |
4920 KB |
Output is correct |
22 |
Correct |
1547 ms |
3356 KB |
Output is correct |
23 |
Correct |
1536 ms |
3304 KB |
Output is correct |
24 |
Correct |
1550 ms |
2392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
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 |
348 KB |
Output is correct |
8 |
Correct |
13 ms |
348 KB |
Output is correct |
9 |
Correct |
12 ms |
344 KB |
Output is correct |
10 |
Correct |
9 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 |
348 KB |
Output is correct |
14 |
Correct |
9 ms |
348 KB |
Output is correct |
15 |
Correct |
8 ms |
348 KB |
Output is correct |
16 |
Correct |
8 ms |
600 KB |
Output is correct |
17 |
Correct |
8 ms |
348 KB |
Output is correct |
18 |
Correct |
10 ms |
348 KB |
Output is correct |
19 |
Correct |
1545 ms |
2856 KB |
Output is correct |
20 |
Correct |
1623 ms |
4144 KB |
Output is correct |
21 |
Correct |
1557 ms |
4092 KB |
Output is correct |
22 |
Correct |
1536 ms |
3772 KB |
Output is correct |
23 |
Correct |
1620 ms |
3280 KB |
Output is correct |
24 |
Correct |
1466 ms |
3128 KB |
Output is correct |
25 |
Correct |
1565 ms |
4564 KB |
Output is correct |
26 |
Correct |
1601 ms |
4168 KB |
Output is correct |
27 |
Correct |
1542 ms |
4100 KB |
Output is correct |
28 |
Correct |
1544 ms |
3312 KB |
Output is correct |
29 |
Correct |
1537 ms |
3472 KB |
Output is correct |
30 |
Correct |
1487 ms |
2320 KB |
Output is correct |
31 |
Correct |
1543 ms |
4644 KB |
Output is correct |
32 |
Correct |
1554 ms |
4592 KB |
Output is correct |
33 |
Correct |
1531 ms |
4264 KB |
Output is correct |
34 |
Correct |
1455 ms |
3744 KB |
Output is correct |
35 |
Correct |
1515 ms |
3900 KB |
Output is correct |
36 |
Correct |
1544 ms |
2808 KB |
Output is correct |
37 |
Correct |
1578 ms |
4688 KB |
Output is correct |
38 |
Correct |
1575 ms |
4664 KB |
Output is correct |
39 |
Correct |
1582 ms |
4920 KB |
Output is correct |
40 |
Correct |
1547 ms |
3356 KB |
Output is correct |
41 |
Correct |
1536 ms |
3304 KB |
Output is correct |
42 |
Correct |
1550 ms |
2392 KB |
Output is correct |
43 |
Correct |
1622 ms |
6832 KB |
Output is correct |
44 |
Correct |
1595 ms |
6636 KB |
Output is correct |
45 |
Correct |
1588 ms |
6492 KB |
Output is correct |
46 |
Correct |
1547 ms |
5152 KB |
Output is correct |
47 |
Correct |
1597 ms |
5384 KB |
Output is correct |
48 |
Correct |
1534 ms |
2664 KB |
Output is correct |
49 |
Correct |
1609 ms |
6432 KB |
Output is correct |
50 |
Correct |
1610 ms |
6552 KB |
Output is correct |
51 |
Correct |
1598 ms |
6564 KB |
Output is correct |
52 |
Correct |
1592 ms |
5088 KB |
Output is correct |
53 |
Correct |
1584 ms |
3928 KB |
Output is correct |