#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
#pragma GCC optimize("Ofast,unroll-loops")
using namespace std;
#define endl '\n'
#define ll long long
#define all(x) x.begin(), x.end()
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q;
cin >> n >> q;
pair<ll, ll> v[n];
for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
while (q--) {
ll x, y, z;
cin >> x >> y >> z;
ll ans = 0;
for (int i = 0; i < n; i++) ans += (v[i].first >= x && v[i].second >= y && v[i].first + v[i].second >= z);
cout << ans << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
316 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
33 ms |
496 KB |
Output is correct |
8 |
Correct |
32 ms |
468 KB |
Output is correct |
9 |
Correct |
33 ms |
512 KB |
Output is correct |
10 |
Correct |
32 ms |
340 KB |
Output is correct |
11 |
Correct |
31 ms |
468 KB |
Output is correct |
12 |
Correct |
29 ms |
400 KB |
Output is correct |
13 |
Correct |
31 ms |
464 KB |
Output is correct |
14 |
Correct |
32 ms |
484 KB |
Output is correct |
15 |
Correct |
32 ms |
488 KB |
Output is correct |
16 |
Correct |
13 ms |
444 KB |
Output is correct |
17 |
Correct |
20 ms |
468 KB |
Output is correct |
18 |
Correct |
10 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3069 ms |
2656 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3069 ms |
2656 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
316 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
33 ms |
496 KB |
Output is correct |
8 |
Correct |
32 ms |
468 KB |
Output is correct |
9 |
Correct |
33 ms |
512 KB |
Output is correct |
10 |
Correct |
32 ms |
340 KB |
Output is correct |
11 |
Correct |
31 ms |
468 KB |
Output is correct |
12 |
Correct |
29 ms |
400 KB |
Output is correct |
13 |
Correct |
31 ms |
464 KB |
Output is correct |
14 |
Correct |
32 ms |
484 KB |
Output is correct |
15 |
Correct |
32 ms |
488 KB |
Output is correct |
16 |
Correct |
13 ms |
444 KB |
Output is correct |
17 |
Correct |
20 ms |
468 KB |
Output is correct |
18 |
Correct |
10 ms |
336 KB |
Output is correct |
19 |
Execution timed out |
3069 ms |
2656 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |