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 long long
#define fr first
#define sc second
#define eb emplace_back
#define nl "\n"
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, q;
cin >> n >> q;
pair<int, int> s[n + 1];
for(int i = 1; i <= n; ++i) cin >> s[i].fr >> s[i].sc;
while(q--) {
int ans = 0;
int x, y, z;
cin >> x >> y >> z;
for(int i = 1; i <= n; ++i) {
if(s[i].fr >= x && s[i].sc >= y && s[i].fr + s[i].sc >= z)
++ans;
}
cout << ans << nl;
}
}
# | 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... |