#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 |
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 |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
11 ms |
348 KB |
Output is correct |
8 |
Correct |
11 ms |
344 KB |
Output is correct |
9 |
Correct |
14 ms |
344 KB |
Output is correct |
10 |
Correct |
10 ms |
348 KB |
Output is correct |
11 |
Correct |
10 ms |
348 KB |
Output is correct |
12 |
Correct |
8 ms |
476 KB |
Output is correct |
13 |
Correct |
10 ms |
348 KB |
Output is correct |
14 |
Correct |
10 ms |
348 KB |
Output is correct |
15 |
Correct |
10 ms |
600 KB |
Output is correct |
16 |
Correct |
9 ms |
348 KB |
Output is correct |
17 |
Correct |
10 ms |
348 KB |
Output is correct |
18 |
Correct |
8 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3031 ms |
2264 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3031 ms |
2264 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
11 ms |
348 KB |
Output is correct |
8 |
Correct |
11 ms |
344 KB |
Output is correct |
9 |
Correct |
14 ms |
344 KB |
Output is correct |
10 |
Correct |
10 ms |
348 KB |
Output is correct |
11 |
Correct |
10 ms |
348 KB |
Output is correct |
12 |
Correct |
8 ms |
476 KB |
Output is correct |
13 |
Correct |
10 ms |
348 KB |
Output is correct |
14 |
Correct |
10 ms |
348 KB |
Output is correct |
15 |
Correct |
10 ms |
600 KB |
Output is correct |
16 |
Correct |
9 ms |
348 KB |
Output is correct |
17 |
Correct |
10 ms |
348 KB |
Output is correct |
18 |
Correct |
8 ms |
348 KB |
Output is correct |
19 |
Execution timed out |
3031 ms |
2264 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |