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>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx")
const int N = 100'010;
int a[N], b[N];
int n, q;
int main()
{
cin.tie(0) -> sync_with_stdio(false);
cin >> n >> q;
Loop (i,0,n)
cin >> a[i] >> b[i];
Loop (i,0,q) {
int x,y,z;
cin >> x >> y >> z;
int ans = 0;
Loop (i,0,n) {
int t1 = -(a[i]>=x);
int t2 = -(b[i]>=y);
int t3 = -(a[i]+b[i]>=z);
ans -= t1 & t2 & t3;
}
cout << ans << '\n';
}
}
# | 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... |