#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 |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 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 |
5 ms |
352 KB |
Output is correct |
8 |
Correct |
5 ms |
340 KB |
Output is correct |
9 |
Correct |
5 ms |
356 KB |
Output is correct |
10 |
Correct |
5 ms |
356 KB |
Output is correct |
11 |
Correct |
6 ms |
340 KB |
Output is correct |
12 |
Correct |
4 ms |
340 KB |
Output is correct |
13 |
Correct |
4 ms |
340 KB |
Output is correct |
14 |
Correct |
5 ms |
356 KB |
Output is correct |
15 |
Correct |
5 ms |
364 KB |
Output is correct |
16 |
Correct |
5 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
360 KB |
Output is correct |
18 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2900 ms |
1652 KB |
Output is correct |
2 |
Correct |
2974 ms |
4068 KB |
Output is correct |
3 |
Correct |
2987 ms |
4028 KB |
Output is correct |
4 |
Correct |
2822 ms |
3392 KB |
Output is correct |
5 |
Correct |
2787 ms |
3404 KB |
Output is correct |
6 |
Correct |
2849 ms |
2636 KB |
Output is correct |
7 |
Correct |
2974 ms |
4176 KB |
Output is correct |
8 |
Correct |
2908 ms |
4152 KB |
Output is correct |
9 |
Correct |
2820 ms |
3972 KB |
Output is correct |
10 |
Correct |
2865 ms |
3212 KB |
Output is correct |
11 |
Execution timed out |
3002 ms |
3148 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2900 ms |
1652 KB |
Output is correct |
2 |
Correct |
2974 ms |
4068 KB |
Output is correct |
3 |
Correct |
2987 ms |
4028 KB |
Output is correct |
4 |
Correct |
2822 ms |
3392 KB |
Output is correct |
5 |
Correct |
2787 ms |
3404 KB |
Output is correct |
6 |
Correct |
2849 ms |
2636 KB |
Output is correct |
7 |
Correct |
2974 ms |
4176 KB |
Output is correct |
8 |
Correct |
2908 ms |
4152 KB |
Output is correct |
9 |
Correct |
2820 ms |
3972 KB |
Output is correct |
10 |
Correct |
2865 ms |
3212 KB |
Output is correct |
11 |
Execution timed out |
3002 ms |
3148 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 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 |
5 ms |
352 KB |
Output is correct |
8 |
Correct |
5 ms |
340 KB |
Output is correct |
9 |
Correct |
5 ms |
356 KB |
Output is correct |
10 |
Correct |
5 ms |
356 KB |
Output is correct |
11 |
Correct |
6 ms |
340 KB |
Output is correct |
12 |
Correct |
4 ms |
340 KB |
Output is correct |
13 |
Correct |
4 ms |
340 KB |
Output is correct |
14 |
Correct |
5 ms |
356 KB |
Output is correct |
15 |
Correct |
5 ms |
364 KB |
Output is correct |
16 |
Correct |
5 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
360 KB |
Output is correct |
18 |
Correct |
4 ms |
340 KB |
Output is correct |
19 |
Correct |
2900 ms |
1652 KB |
Output is correct |
20 |
Correct |
2974 ms |
4068 KB |
Output is correct |
21 |
Correct |
2987 ms |
4028 KB |
Output is correct |
22 |
Correct |
2822 ms |
3392 KB |
Output is correct |
23 |
Correct |
2787 ms |
3404 KB |
Output is correct |
24 |
Correct |
2849 ms |
2636 KB |
Output is correct |
25 |
Correct |
2974 ms |
4176 KB |
Output is correct |
26 |
Correct |
2908 ms |
4152 KB |
Output is correct |
27 |
Correct |
2820 ms |
3972 KB |
Output is correct |
28 |
Correct |
2865 ms |
3212 KB |
Output is correct |
29 |
Execution timed out |
3002 ms |
3148 KB |
Time limit exceeded |
30 |
Halted |
0 ms |
0 KB |
- |