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 mod 1000000007
#define mp make_pair
#define pb push_back
#define bas(x) #x << ": " << x
#define prarr(x, n) cout << #x << ": "; for (int qsd = 0; qsd < n; qsd++) cout << x[qsd] << " "; cout << endl;
#define prarrv(x) cout << #x << ": "; for (int qsd = 0; qsd < (int)x.size(); qsd++) cout << x[qsd] << " "; cout << endl;
#define inside sl<=l%&&r<=sr
#define outside sr<l||r<sl
typedef long long ll;
int n, q;
pair<ll, ll> st[3003];
int main(){
cin >> n >> q;
for (int i = 0; i < n; i++){
cin >> st[i].first >> st[i].second;
}
for (int i = 0; i < q; i++){
ll a, b, c;
cin >> a >> b >> c;
ll ans = 0;
for (int j = 0; j < n; j++){
if (st[j].first >= a && st[j].second >= b && st[j].first + st[j].second >= c) ans++;
}
cout << ans << 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... |