제출 #131447

#제출 시각아이디문제언어결과실행 시간메모리
131447SirCenessExamination (JOI19_examination)C++14
2 / 100
225 ms504 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...