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;
typedef long long int ll;
typedef std::vector<ll> vi;
typedef pair < ll , ll > pll;
#define pb push_back
#define mp make_pair
ll pw(ll x , ll p){
ll r = 1;
while (p > 0){
if (p & 1){
r *= x;
p --;
}
x *= x;
p /= 2;
}
return r;
}
ll n , q;
vector < pll > S;
vi So;
int main(){
cin >> n >> q;
for (ll i = 0 ; i < n ; i ++){
ll a , b;
cin >> a >>b;
S.pb(mp(a , b));
So.pb(a + b);
}
for (ll i = 0 ; i < q ; i ++){
ll x , y , z;
cin >> x >> y >> z;
ll r = 0;
for (ll j = 0 ; j < n ; j ++){
if (S[j].first >= x and S[j].second >= y and So[j] >= z){
r ++;
}
}
cout << r << endl;
}
return 0;
}
# | 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... |