#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
#pragma GCC target ("avx2")
#pragma GCC optimize("O3")
#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;
int a[n], b[n];
for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
while (q--) {
int x, y, z, ans = 0;
cin >> x >> y >> z;
for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= z);
cout << ans << '\n';
}
}
Compilation message
examination.cpp: In function 'int main()':
examination.cpp:29:50: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
29 | for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= z);
| ~~~~~^~~~
examination.cpp:29:81: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
29 | for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= z);
| ~~~~~~~~~~~~^~~~
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
3 ms |
348 KB |
Output is correct |
8 |
Correct |
3 ms |
340 KB |
Output is correct |
9 |
Correct |
3 ms |
340 KB |
Output is correct |
10 |
Correct |
3 ms |
340 KB |
Output is correct |
11 |
Correct |
3 ms |
340 KB |
Output is correct |
12 |
Correct |
3 ms |
340 KB |
Output is correct |
13 |
Correct |
3 ms |
356 KB |
Output is correct |
14 |
Correct |
3 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
340 KB |
Output is correct |
16 |
Correct |
3 ms |
340 KB |
Output is correct |
17 |
Correct |
3 ms |
344 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1553 ms |
1620 KB |
Output is correct |
2 |
Correct |
1517 ms |
2788 KB |
Output is correct |
3 |
Correct |
1552 ms |
2700 KB |
Output is correct |
4 |
Correct |
1483 ms |
2820 KB |
Output is correct |
5 |
Correct |
1537 ms |
2684 KB |
Output is correct |
6 |
Correct |
1475 ms |
2644 KB |
Output is correct |
7 |
Correct |
1496 ms |
2784 KB |
Output is correct |
8 |
Correct |
1448 ms |
2732 KB |
Output is correct |
9 |
Correct |
1489 ms |
3108 KB |
Output is correct |
10 |
Correct |
1451 ms |
3268 KB |
Output is correct |
11 |
Correct |
1487 ms |
3212 KB |
Output is correct |
12 |
Correct |
1485 ms |
2184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1553 ms |
1620 KB |
Output is correct |
2 |
Correct |
1517 ms |
2788 KB |
Output is correct |
3 |
Correct |
1552 ms |
2700 KB |
Output is correct |
4 |
Correct |
1483 ms |
2820 KB |
Output is correct |
5 |
Correct |
1537 ms |
2684 KB |
Output is correct |
6 |
Correct |
1475 ms |
2644 KB |
Output is correct |
7 |
Correct |
1496 ms |
2784 KB |
Output is correct |
8 |
Correct |
1448 ms |
2732 KB |
Output is correct |
9 |
Correct |
1489 ms |
3108 KB |
Output is correct |
10 |
Correct |
1451 ms |
3268 KB |
Output is correct |
11 |
Correct |
1487 ms |
3212 KB |
Output is correct |
12 |
Correct |
1485 ms |
2184 KB |
Output is correct |
13 |
Correct |
1541 ms |
4588 KB |
Output is correct |
14 |
Correct |
1524 ms |
4512 KB |
Output is correct |
15 |
Correct |
1438 ms |
4096 KB |
Output is correct |
16 |
Correct |
1516 ms |
3752 KB |
Output is correct |
17 |
Correct |
1456 ms |
3696 KB |
Output is correct |
18 |
Correct |
1495 ms |
2692 KB |
Output is correct |
19 |
Correct |
1450 ms |
4432 KB |
Output is correct |
20 |
Correct |
1526 ms |
4672 KB |
Output is correct |
21 |
Correct |
1506 ms |
4548 KB |
Output is correct |
22 |
Correct |
1503 ms |
3220 KB |
Output is correct |
23 |
Correct |
1473 ms |
3208 KB |
Output is correct |
24 |
Correct |
1482 ms |
2268 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
3 ms |
348 KB |
Output is correct |
8 |
Correct |
3 ms |
340 KB |
Output is correct |
9 |
Correct |
3 ms |
340 KB |
Output is correct |
10 |
Correct |
3 ms |
340 KB |
Output is correct |
11 |
Correct |
3 ms |
340 KB |
Output is correct |
12 |
Correct |
3 ms |
340 KB |
Output is correct |
13 |
Correct |
3 ms |
356 KB |
Output is correct |
14 |
Correct |
3 ms |
340 KB |
Output is correct |
15 |
Correct |
3 ms |
340 KB |
Output is correct |
16 |
Correct |
3 ms |
340 KB |
Output is correct |
17 |
Correct |
3 ms |
344 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
1553 ms |
1620 KB |
Output is correct |
20 |
Correct |
1517 ms |
2788 KB |
Output is correct |
21 |
Correct |
1552 ms |
2700 KB |
Output is correct |
22 |
Correct |
1483 ms |
2820 KB |
Output is correct |
23 |
Correct |
1537 ms |
2684 KB |
Output is correct |
24 |
Correct |
1475 ms |
2644 KB |
Output is correct |
25 |
Correct |
1496 ms |
2784 KB |
Output is correct |
26 |
Correct |
1448 ms |
2732 KB |
Output is correct |
27 |
Correct |
1489 ms |
3108 KB |
Output is correct |
28 |
Correct |
1451 ms |
3268 KB |
Output is correct |
29 |
Correct |
1487 ms |
3212 KB |
Output is correct |
30 |
Correct |
1485 ms |
2184 KB |
Output is correct |
31 |
Correct |
1541 ms |
4588 KB |
Output is correct |
32 |
Correct |
1524 ms |
4512 KB |
Output is correct |
33 |
Correct |
1438 ms |
4096 KB |
Output is correct |
34 |
Correct |
1516 ms |
3752 KB |
Output is correct |
35 |
Correct |
1456 ms |
3696 KB |
Output is correct |
36 |
Correct |
1495 ms |
2692 KB |
Output is correct |
37 |
Correct |
1450 ms |
4432 KB |
Output is correct |
38 |
Correct |
1526 ms |
4672 KB |
Output is correct |
39 |
Correct |
1506 ms |
4548 KB |
Output is correct |
40 |
Correct |
1503 ms |
3220 KB |
Output is correct |
41 |
Correct |
1473 ms |
3208 KB |
Output is correct |
42 |
Correct |
1482 ms |
2268 KB |
Output is correct |
43 |
Correct |
1523 ms |
6392 KB |
Output is correct |
44 |
Correct |
1567 ms |
6424 KB |
Output is correct |
45 |
Correct |
1540 ms |
6364 KB |
Output is correct |
46 |
Correct |
1482 ms |
4860 KB |
Output is correct |
47 |
Correct |
1525 ms |
4920 KB |
Output is correct |
48 |
Correct |
1481 ms |
2504 KB |
Output is correct |
49 |
Correct |
1511 ms |
6552 KB |
Output is correct |
50 |
Correct |
1538 ms |
6392 KB |
Output is correct |
51 |
Correct |
1512 ms |
6292 KB |
Output is correct |
52 |
Correct |
1558 ms |
4704 KB |
Output is correct |
53 |
Correct |
1555 ms |
3988 KB |
Output is correct |