Submission #131423

#TimeUsernameProblemLanguageResultExecution timeMemory
131423Lord_ZebellakExamination (JOI19_examination)C++14
2 / 100
3089 ms5300 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...