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;
const int MAXN = 1000;
int s[MAXN+1],t[MAXN+1];
int n,q;
int main() {
cin.tie(0) -> sync_with_stdio(0);
cin >> n >> q;
for (int i=1;i<=n;i++) cin >> s[i] >> t[i];
for (int i=1;i<=q;i++) {
int a,b,c; cin >> a >> b >> c;
int ans = 0;
for (int j=1;j<=n;j++) {
if (s[j] >= a && t[j] >= b && s[j] + t[j] >= c) ans++;
}
cout << ans << '\n';
}
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... |