#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5;
int S[MAX_N], T[MAX_N];
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int N, Q;
cin >> N >> Q;
for (int i = 0; i < N; i++) {
cin >> S[i] >> T[i];
}
for (int i = 0; i < Q; i++) {
int x, y, z;
cin >> x >> y >> z;
int ans = 0;
for (int j = 0; j < N; j++) {
ans += S[j] >= x && T[j] >= y && S[j] + T[j] >= z;
}
cout << ans << "\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
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 |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
4 ms |
340 KB |
Output is correct |
8 |
Correct |
5 ms |
340 KB |
Output is correct |
9 |
Correct |
4 ms |
340 KB |
Output is correct |
10 |
Correct |
4 ms |
340 KB |
Output is correct |
11 |
Correct |
4 ms |
340 KB |
Output is correct |
12 |
Correct |
3 ms |
356 KB |
Output is correct |
13 |
Correct |
4 ms |
340 KB |
Output is correct |
14 |
Correct |
4 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
340 KB |
Output is correct |
16 |
Correct |
4 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
340 KB |
Output is correct |
18 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2393 ms |
1552 KB |
Output is correct |
2 |
Correct |
2492 ms |
1536 KB |
Output is correct |
3 |
Correct |
2480 ms |
1620 KB |
Output is correct |
4 |
Correct |
2406 ms |
1748 KB |
Output is correct |
5 |
Correct |
2551 ms |
1632 KB |
Output is correct |
6 |
Correct |
2445 ms |
1660 KB |
Output is correct |
7 |
Correct |
2436 ms |
1732 KB |
Output is correct |
8 |
Correct |
2499 ms |
1728 KB |
Output is correct |
9 |
Correct |
2423 ms |
1616 KB |
Output is correct |
10 |
Correct |
2399 ms |
1548 KB |
Output is correct |
11 |
Correct |
2427 ms |
1476 KB |
Output is correct |
12 |
Correct |
2484 ms |
1380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2393 ms |
1552 KB |
Output is correct |
2 |
Correct |
2492 ms |
1536 KB |
Output is correct |
3 |
Correct |
2480 ms |
1620 KB |
Output is correct |
4 |
Correct |
2406 ms |
1748 KB |
Output is correct |
5 |
Correct |
2551 ms |
1632 KB |
Output is correct |
6 |
Correct |
2445 ms |
1660 KB |
Output is correct |
7 |
Correct |
2436 ms |
1732 KB |
Output is correct |
8 |
Correct |
2499 ms |
1728 KB |
Output is correct |
9 |
Correct |
2423 ms |
1616 KB |
Output is correct |
10 |
Correct |
2399 ms |
1548 KB |
Output is correct |
11 |
Correct |
2427 ms |
1476 KB |
Output is correct |
12 |
Correct |
2484 ms |
1380 KB |
Output is correct |
13 |
Correct |
2546 ms |
1524 KB |
Output is correct |
14 |
Correct |
2526 ms |
1720 KB |
Output is correct |
15 |
Correct |
2534 ms |
1580 KB |
Output is correct |
16 |
Correct |
2547 ms |
1568 KB |
Output is correct |
17 |
Correct |
2469 ms |
1688 KB |
Output is correct |
18 |
Correct |
2472 ms |
1656 KB |
Output is correct |
19 |
Correct |
2469 ms |
1544 KB |
Output is correct |
20 |
Correct |
2589 ms |
1648 KB |
Output is correct |
21 |
Correct |
2462 ms |
1652 KB |
Output is correct |
22 |
Correct |
2526 ms |
1496 KB |
Output is correct |
23 |
Correct |
2464 ms |
1432 KB |
Output is correct |
24 |
Correct |
2437 ms |
1224 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 |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
4 ms |
340 KB |
Output is correct |
8 |
Correct |
5 ms |
340 KB |
Output is correct |
9 |
Correct |
4 ms |
340 KB |
Output is correct |
10 |
Correct |
4 ms |
340 KB |
Output is correct |
11 |
Correct |
4 ms |
340 KB |
Output is correct |
12 |
Correct |
3 ms |
356 KB |
Output is correct |
13 |
Correct |
4 ms |
340 KB |
Output is correct |
14 |
Correct |
4 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
340 KB |
Output is correct |
16 |
Correct |
4 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
340 KB |
Output is correct |
18 |
Correct |
3 ms |
468 KB |
Output is correct |
19 |
Correct |
2393 ms |
1552 KB |
Output is correct |
20 |
Correct |
2492 ms |
1536 KB |
Output is correct |
21 |
Correct |
2480 ms |
1620 KB |
Output is correct |
22 |
Correct |
2406 ms |
1748 KB |
Output is correct |
23 |
Correct |
2551 ms |
1632 KB |
Output is correct |
24 |
Correct |
2445 ms |
1660 KB |
Output is correct |
25 |
Correct |
2436 ms |
1732 KB |
Output is correct |
26 |
Correct |
2499 ms |
1728 KB |
Output is correct |
27 |
Correct |
2423 ms |
1616 KB |
Output is correct |
28 |
Correct |
2399 ms |
1548 KB |
Output is correct |
29 |
Correct |
2427 ms |
1476 KB |
Output is correct |
30 |
Correct |
2484 ms |
1380 KB |
Output is correct |
31 |
Correct |
2546 ms |
1524 KB |
Output is correct |
32 |
Correct |
2526 ms |
1720 KB |
Output is correct |
33 |
Correct |
2534 ms |
1580 KB |
Output is correct |
34 |
Correct |
2547 ms |
1568 KB |
Output is correct |
35 |
Correct |
2469 ms |
1688 KB |
Output is correct |
36 |
Correct |
2472 ms |
1656 KB |
Output is correct |
37 |
Correct |
2469 ms |
1544 KB |
Output is correct |
38 |
Correct |
2589 ms |
1648 KB |
Output is correct |
39 |
Correct |
2462 ms |
1652 KB |
Output is correct |
40 |
Correct |
2526 ms |
1496 KB |
Output is correct |
41 |
Correct |
2464 ms |
1432 KB |
Output is correct |
42 |
Correct |
2437 ms |
1224 KB |
Output is correct |
43 |
Correct |
2441 ms |
1552 KB |
Output is correct |
44 |
Correct |
2446 ms |
1528 KB |
Output is correct |
45 |
Correct |
2463 ms |
1544 KB |
Output is correct |
46 |
Correct |
2435 ms |
1608 KB |
Output is correct |
47 |
Correct |
2587 ms |
1592 KB |
Output is correct |
48 |
Correct |
2411 ms |
1444 KB |
Output is correct |
49 |
Correct |
2459 ms |
1676 KB |
Output is correct |
50 |
Correct |
2535 ms |
1688 KB |
Output is correct |
51 |
Correct |
2521 ms |
1676 KB |
Output is correct |
52 |
Correct |
2478 ms |
1584 KB |
Output is correct |
53 |
Correct |
2587 ms |
1476 KB |
Output is correct |