#include <bits/stdc++.h>
using namespace std;
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 |
344 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 |
46 ms |
480 KB |
Output is correct |
8 |
Correct |
46 ms |
344 KB |
Output is correct |
9 |
Correct |
46 ms |
460 KB |
Output is correct |
10 |
Correct |
45 ms |
348 KB |
Output is correct |
11 |
Correct |
46 ms |
452 KB |
Output is correct |
12 |
Correct |
51 ms |
812 KB |
Output is correct |
13 |
Correct |
46 ms |
596 KB |
Output is correct |
14 |
Correct |
46 ms |
344 KB |
Output is correct |
15 |
Correct |
46 ms |
344 KB |
Output is correct |
16 |
Correct |
25 ms |
344 KB |
Output is correct |
17 |
Correct |
36 ms |
596 KB |
Output is correct |
18 |
Correct |
14 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3046 ms |
1436 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3046 ms |
1436 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
46 ms |
480 KB |
Output is correct |
8 |
Correct |
46 ms |
344 KB |
Output is correct |
9 |
Correct |
46 ms |
460 KB |
Output is correct |
10 |
Correct |
45 ms |
348 KB |
Output is correct |
11 |
Correct |
46 ms |
452 KB |
Output is correct |
12 |
Correct |
51 ms |
812 KB |
Output is correct |
13 |
Correct |
46 ms |
596 KB |
Output is correct |
14 |
Correct |
46 ms |
344 KB |
Output is correct |
15 |
Correct |
46 ms |
344 KB |
Output is correct |
16 |
Correct |
25 ms |
344 KB |
Output is correct |
17 |
Correct |
36 ms |
596 KB |
Output is correct |
18 |
Correct |
14 ms |
348 KB |
Output is correct |
19 |
Execution timed out |
3046 ms |
1436 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |