답안 #788758

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
788758 2023-07-20T14:52:58 Z ooscode Examination (JOI19_examination) C++14
100 / 100
1970 ms 2140 KB
#include<iostream>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,unroll-loops")
using namespace std;

int ans;
int a[100000] , b[100000];
int x , y , z , n , q;

int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	scanf("%d %d" , &n , &q);
	for(int i = 0 ; i < n ; i++)
		scanf("%d %d" , &a[i] , &b[i]);
	while(q--) {
		ans = 0;
		scanf("%d %d %d" , &x , &y , &z);
		for(int i = 0 ; i < n ; i++)
			ans += (x <= a[i] & y <= b[i] & z <= a[i]+b[i]);
		cout << ans << "\n";
	}
	return 0;
}

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:20:14: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   20 |    ans += (x <= a[i] & y <= b[i] & z <= a[i]+b[i]);
      |            ~~^~~~~~~
examination.cpp:20:38: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   20 |    ans += (x <= a[i] & y <= b[i] & z <= a[i]+b[i]);
      |                                    ~~^~~~~~~~~~~~
examination.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  scanf("%d %d" , &n , &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~
examination.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d %d" , &a[i] , &b[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf("%d %d %d" , &x , &y , &z);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 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 340 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 3 ms 340 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 5 ms 360 KB Output is correct
14 Correct 3 ms 352 KB Output is correct
15 Correct 3 ms 364 KB Output is correct
16 Correct 5 ms 356 KB Output is correct
17 Correct 3 ms 340 KB Output is correct
18 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1371 ms 1628 KB Output is correct
2 Correct 1409 ms 1624 KB Output is correct
3 Correct 1300 ms 1628 KB Output is correct
4 Correct 1276 ms 1652 KB Output is correct
5 Correct 1286 ms 1648 KB Output is correct
6 Correct 1350 ms 1632 KB Output is correct
7 Correct 1359 ms 1748 KB Output is correct
8 Correct 1267 ms 1600 KB Output is correct
9 Correct 1324 ms 1668 KB Output is correct
10 Correct 1362 ms 1364 KB Output is correct
11 Correct 1434 ms 1468 KB Output is correct
12 Correct 1306 ms 1324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1371 ms 1628 KB Output is correct
2 Correct 1409 ms 1624 KB Output is correct
3 Correct 1300 ms 1628 KB Output is correct
4 Correct 1276 ms 1652 KB Output is correct
5 Correct 1286 ms 1648 KB Output is correct
6 Correct 1350 ms 1632 KB Output is correct
7 Correct 1359 ms 1748 KB Output is correct
8 Correct 1267 ms 1600 KB Output is correct
9 Correct 1324 ms 1668 KB Output is correct
10 Correct 1362 ms 1364 KB Output is correct
11 Correct 1434 ms 1468 KB Output is correct
12 Correct 1306 ms 1324 KB Output is correct
13 Correct 1398 ms 1932 KB Output is correct
14 Correct 1383 ms 1952 KB Output is correct
15 Correct 1331 ms 1632 KB Output is correct
16 Correct 1651 ms 1932 KB Output is correct
17 Correct 1970 ms 1884 KB Output is correct
18 Correct 1288 ms 1736 KB Output is correct
19 Correct 1354 ms 1980 KB Output is correct
20 Correct 1438 ms 1916 KB Output is correct
21 Correct 1305 ms 1852 KB Output is correct
22 Correct 1423 ms 1812 KB Output is correct
23 Correct 1348 ms 1580 KB Output is correct
24 Correct 1317 ms 1788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 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 340 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 3 ms 340 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 5 ms 360 KB Output is correct
14 Correct 3 ms 352 KB Output is correct
15 Correct 3 ms 364 KB Output is correct
16 Correct 5 ms 356 KB Output is correct
17 Correct 3 ms 340 KB Output is correct
18 Correct 3 ms 340 KB Output is correct
19 Correct 1371 ms 1628 KB Output is correct
20 Correct 1409 ms 1624 KB Output is correct
21 Correct 1300 ms 1628 KB Output is correct
22 Correct 1276 ms 1652 KB Output is correct
23 Correct 1286 ms 1648 KB Output is correct
24 Correct 1350 ms 1632 KB Output is correct
25 Correct 1359 ms 1748 KB Output is correct
26 Correct 1267 ms 1600 KB Output is correct
27 Correct 1324 ms 1668 KB Output is correct
28 Correct 1362 ms 1364 KB Output is correct
29 Correct 1434 ms 1468 KB Output is correct
30 Correct 1306 ms 1324 KB Output is correct
31 Correct 1398 ms 1932 KB Output is correct
32 Correct 1383 ms 1952 KB Output is correct
33 Correct 1331 ms 1632 KB Output is correct
34 Correct 1651 ms 1932 KB Output is correct
35 Correct 1970 ms 1884 KB Output is correct
36 Correct 1288 ms 1736 KB Output is correct
37 Correct 1354 ms 1980 KB Output is correct
38 Correct 1438 ms 1916 KB Output is correct
39 Correct 1305 ms 1852 KB Output is correct
40 Correct 1423 ms 1812 KB Output is correct
41 Correct 1348 ms 1580 KB Output is correct
42 Correct 1317 ms 1788 KB Output is correct
43 Correct 1314 ms 1944 KB Output is correct
44 Correct 1385 ms 1964 KB Output is correct
45 Correct 1351 ms 1652 KB Output is correct
46 Correct 1287 ms 1812 KB Output is correct
47 Correct 1355 ms 1680 KB Output is correct
48 Correct 1332 ms 1608 KB Output is correct
49 Correct 1362 ms 1880 KB Output is correct
50 Correct 1301 ms 2004 KB Output is correct
51 Correct 1339 ms 2140 KB Output is correct
52 Correct 1354 ms 1616 KB Output is correct
53 Correct 1277 ms 1856 KB Output is correct