#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(lli = x; i>y; i--)
using namespace std;
int main(){
ll n,q;
cin >> n >> q;
vector<vector<ll>> st;
FOR(i,0,n){
ll a,b;
cin >> a >> b;
st.push_back({a,b});
}
FOR(i,0,q){
ll x,y,z;
cin >> x >> y >> z;
ll ans = 0;
for (auto&i : st){
if (i[0]>=x && i[1]>=y && i[0]+i[1]>=z) 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 |
43 ms |
768 KB |
Output is correct |
8 |
Correct |
42 ms |
604 KB |
Output is correct |
9 |
Correct |
43 ms |
860 KB |
Output is correct |
10 |
Correct |
42 ms |
604 KB |
Output is correct |
11 |
Correct |
41 ms |
728 KB |
Output is correct |
12 |
Correct |
39 ms |
600 KB |
Output is correct |
13 |
Correct |
42 ms |
604 KB |
Output is correct |
14 |
Correct |
42 ms |
600 KB |
Output is correct |
15 |
Correct |
42 ms |
604 KB |
Output is correct |
16 |
Correct |
23 ms |
600 KB |
Output is correct |
17 |
Correct |
33 ms |
604 KB |
Output is correct |
18 |
Correct |
14 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3026 ms |
7292 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3026 ms |
7292 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 |
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 |
43 ms |
768 KB |
Output is correct |
8 |
Correct |
42 ms |
604 KB |
Output is correct |
9 |
Correct |
43 ms |
860 KB |
Output is correct |
10 |
Correct |
42 ms |
604 KB |
Output is correct |
11 |
Correct |
41 ms |
728 KB |
Output is correct |
12 |
Correct |
39 ms |
600 KB |
Output is correct |
13 |
Correct |
42 ms |
604 KB |
Output is correct |
14 |
Correct |
42 ms |
600 KB |
Output is correct |
15 |
Correct |
42 ms |
604 KB |
Output is correct |
16 |
Correct |
23 ms |
600 KB |
Output is correct |
17 |
Correct |
33 ms |
604 KB |
Output is correct |
18 |
Correct |
14 ms |
604 KB |
Output is correct |
19 |
Execution timed out |
3026 ms |
7292 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |