Submission #716074

# Submission time Handle Problem Language Result Execution time Memory
716074 2023-03-28T22:11:09 Z bane Examination (JOI19_examination) C++17
100 / 100
2987 ms 6588 KB
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")     
using namespace std;
       
#ifdef LOCAL
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
       
#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
#define frs first
#define sc second
#define eb emplace_back
#define fr(i, n, m) for(int i = (n); i < (m); i ++)     
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
int dx[4] = {0,0,1,-1};
int dy[4] = {-1,1,0,0};
const int Block = 310;
int n,q;
int A[100001], B[100001];
       
int main() {
	scanf("%d%d", &n, &q);
	fr(i, 0, n)
		scanf("%d%d", &A[i], &B[i]);
	while(q--){
		int x,y,z;
		scanf("%d%d%d", &x, &y, &z);
		int ans = 0;
		fr(i, 0, n){
			ans+=(A[i] >= x) & (B[i] >= y) & (A[i] + B[i] >= z);
		}
		printf("%d\n", ans);
	}
}

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:35:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |  scanf("%d%d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~
examination.cpp:37:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |   scanf("%d%d", &A[i], &B[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
examination.cpp:40:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |   scanf("%d%d%d", &x, &y, &z);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 5 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 5 ms 340 KB Output is correct
14 Correct 5 ms 340 KB Output is correct
15 Correct 5 ms 340 KB Output is correct
16 Correct 5 ms 340 KB Output is correct
17 Correct 5 ms 212 KB Output is correct
18 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2920 ms 1640 KB Output is correct
2 Correct 2724 ms 3236 KB Output is correct
3 Correct 2633 ms 3436 KB Output is correct
4 Correct 2793 ms 3292 KB Output is correct
5 Correct 2682 ms 3400 KB Output is correct
6 Correct 2672 ms 2844 KB Output is correct
7 Correct 2707 ms 3340 KB Output is correct
8 Correct 2721 ms 3252 KB Output is correct
9 Correct 2785 ms 3548 KB Output is correct
10 Correct 2793 ms 3068 KB Output is correct
11 Correct 2736 ms 3148 KB Output is correct
12 Correct 2665 ms 2288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2920 ms 1640 KB Output is correct
2 Correct 2724 ms 3236 KB Output is correct
3 Correct 2633 ms 3436 KB Output is correct
4 Correct 2793 ms 3292 KB Output is correct
5 Correct 2682 ms 3400 KB Output is correct
6 Correct 2672 ms 2844 KB Output is correct
7 Correct 2707 ms 3340 KB Output is correct
8 Correct 2721 ms 3252 KB Output is correct
9 Correct 2785 ms 3548 KB Output is correct
10 Correct 2793 ms 3068 KB Output is correct
11 Correct 2736 ms 3148 KB Output is correct
12 Correct 2665 ms 2288 KB Output is correct
13 Correct 2551 ms 3176 KB Output is correct
14 Correct 2758 ms 4620 KB Output is correct
15 Correct 2589 ms 4216 KB Output is correct
16 Correct 2736 ms 3856 KB Output is correct
17 Correct 2666 ms 3944 KB Output is correct
18 Correct 2718 ms 2836 KB Output is correct
19 Correct 2539 ms 4548 KB Output is correct
20 Correct 2636 ms 4728 KB Output is correct
21 Correct 2626 ms 4588 KB Output is correct
22 Correct 2637 ms 3296 KB Output is correct
23 Correct 2663 ms 3288 KB Output is correct
24 Correct 2607 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 5 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 5 ms 340 KB Output is correct
14 Correct 5 ms 340 KB Output is correct
15 Correct 5 ms 340 KB Output is correct
16 Correct 5 ms 340 KB Output is correct
17 Correct 5 ms 212 KB Output is correct
18 Correct 4 ms 340 KB Output is correct
19 Correct 2920 ms 1640 KB Output is correct
20 Correct 2724 ms 3236 KB Output is correct
21 Correct 2633 ms 3436 KB Output is correct
22 Correct 2793 ms 3292 KB Output is correct
23 Correct 2682 ms 3400 KB Output is correct
24 Correct 2672 ms 2844 KB Output is correct
25 Correct 2707 ms 3340 KB Output is correct
26 Correct 2721 ms 3252 KB Output is correct
27 Correct 2785 ms 3548 KB Output is correct
28 Correct 2793 ms 3068 KB Output is correct
29 Correct 2736 ms 3148 KB Output is correct
30 Correct 2665 ms 2288 KB Output is correct
31 Correct 2551 ms 3176 KB Output is correct
32 Correct 2758 ms 4620 KB Output is correct
33 Correct 2589 ms 4216 KB Output is correct
34 Correct 2736 ms 3856 KB Output is correct
35 Correct 2666 ms 3944 KB Output is correct
36 Correct 2718 ms 2836 KB Output is correct
37 Correct 2539 ms 4548 KB Output is correct
38 Correct 2636 ms 4728 KB Output is correct
39 Correct 2626 ms 4588 KB Output is correct
40 Correct 2637 ms 3296 KB Output is correct
41 Correct 2663 ms 3288 KB Output is correct
42 Correct 2607 ms 2396 KB Output is correct
43 Correct 2752 ms 6552 KB Output is correct
44 Correct 2675 ms 6504 KB Output is correct
45 Correct 2677 ms 6588 KB Output is correct
46 Correct 2672 ms 5188 KB Output is correct
47 Correct 2603 ms 4896 KB Output is correct
48 Correct 2571 ms 2564 KB Output is correct
49 Correct 2675 ms 6516 KB Output is correct
50 Correct 2733 ms 6408 KB Output is correct
51 Correct 2831 ms 6336 KB Output is correct
52 Correct 2987 ms 4732 KB Output is correct
53 Correct 2630 ms 3984 KB Output is correct