#include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
const int inf = 1e9 + 7;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const int sz = 2e5 + 5;
signed main(){
int n, q;
cin >> n >> q;
vector<pair<int,int>>v(n);
for(pair<int,int>& p : v){
cin >> p.first >> p.second;
}
while(q--){
int a, b, c, cnt = 0;
cin >> a >> b >> c;
for(int i = 0; i < n; ++i){
if(v[i].first >= a && v[i].second >= b && v[i].first + v[i].second >= c){
cnt++;
}
}
cout << cnt << endl;
}
}
# |
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 |
432 KB |
Output is correct |
4 |
Correct |
1 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 |
37 ms |
604 KB |
Output is correct |
8 |
Correct |
36 ms |
604 KB |
Output is correct |
9 |
Correct |
37 ms |
600 KB |
Output is correct |
10 |
Correct |
35 ms |
348 KB |
Output is correct |
11 |
Correct |
36 ms |
344 KB |
Output is correct |
12 |
Correct |
34 ms |
344 KB |
Output is correct |
13 |
Correct |
38 ms |
604 KB |
Output is correct |
14 |
Correct |
37 ms |
612 KB |
Output is correct |
15 |
Correct |
36 ms |
604 KB |
Output is correct |
16 |
Correct |
22 ms |
564 KB |
Output is correct |
17 |
Correct |
26 ms |
344 KB |
Output is correct |
18 |
Correct |
12 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3081 ms |
3520 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3081 ms |
3520 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
432 KB |
Output is correct |
4 |
Correct |
1 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 |
37 ms |
604 KB |
Output is correct |
8 |
Correct |
36 ms |
604 KB |
Output is correct |
9 |
Correct |
37 ms |
600 KB |
Output is correct |
10 |
Correct |
35 ms |
348 KB |
Output is correct |
11 |
Correct |
36 ms |
344 KB |
Output is correct |
12 |
Correct |
34 ms |
344 KB |
Output is correct |
13 |
Correct |
38 ms |
604 KB |
Output is correct |
14 |
Correct |
37 ms |
612 KB |
Output is correct |
15 |
Correct |
36 ms |
604 KB |
Output is correct |
16 |
Correct |
22 ms |
564 KB |
Output is correct |
17 |
Correct |
26 ms |
344 KB |
Output is correct |
18 |
Correct |
12 ms |
344 KB |
Output is correct |
19 |
Execution timed out |
3081 ms |
3520 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |