This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |