This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
* Created: 2022-07-08 00:01
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using namespace chrono;
// using namespace atcoder
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define rep(i, a, b) for(int i = (a);i<(b);i++)
#define repn(i, a, b) for(int i = (a);i>=(b);i--)
#define ss second
#define ff first
#define mkp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
void solve() {
int n, q;
cin >> n >> q;
ll s[n], t[n];
rep(i, 0, n)cin >> s[i] >> t[i];
while(q--) {
ll x, y, z;
cin >> x >> y >> z;
int cnt=0;
rep(i, 0, n) {
if(s[i] >= x and t[i] >= y and s[i]+t[i]>=z)cnt++;
}
cout<<cnt<<"\n";
}
}
int main () {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
while(t--) {
solve();
}
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... |