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 lli long long
#define INF LONG_LONG_MAX
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define endl '\n'
#define max(aa, bb) (aa > bb ? aa:bb)
#define min(aa, bb) (aa < bb ? aa:bb)
#define min3(aa, bb, cc) cout<<aa<<" "<<bb<<" "<<cc<<endl
#define all(aa) aa.begin(), aa.end()
int main(){
#ifdef ONLINE_JUDGE
freopen("zgir.gir", "r", stdin);
freopen("zcik.cik", "w", stdout);
#endif
lli n,q;
cin>>n>>q;
vector<pair<lli ,lli> > v(n);
for(auto &it:v) cin>>it.st>>it.nd;
while(q--){
lli mat, bil, sum, cvp=0;
cin>>mat>>bil>>sum;
for(auto &it:v) if(it.st>=mat && it.nd>=bil && it.st+it.nd>=sum) cvp++;
cout<<cvp<<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... |