Submission #497650

# Submission time Handle Problem Language Result Execution time Memory
497650 2021-12-23T12:59:50 Z penguin133 Examination (JOI19_examination) C++17
2 / 100
3000 ms 2992 KB
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx2,popcnt")

#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, q, s[N], t[N];

int main() {
	scanf("%d %d", &n, &q);
	for (int i = 1; i <= n; i++) {
		scanf("%d %d", &s[i], &t[i]);
	}
	while (q--) {
		int x, y, z, ans = 0;
		scanf("%d %d %d", &x, &y, &z);
		for (int i = 1; i <= n; i++)
			if (s[i] >= x && t[i] >= y && s[i] + t[i] >= z) ans++;
		printf("%d\n", ans);
	}
	return 0;
}

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d %d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~
examination.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d %d", &s[i], &t[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |   scanf("%d %d %d", &x, &y, &z);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 6 ms 460 KB Output is correct
8 Correct 7 ms 460 KB Output is correct
9 Correct 6 ms 416 KB Output is correct
10 Correct 6 ms 424 KB Output is correct
11 Correct 5 ms 332 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 460 KB Output is correct
14 Correct 5 ms 392 KB Output is correct
15 Correct 5 ms 460 KB Output is correct
16 Correct 5 ms 316 KB Output is correct
17 Correct 6 ms 288 KB Output is correct
18 Correct 6 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3082 ms 2992 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3082 ms 2992 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 6 ms 460 KB Output is correct
8 Correct 7 ms 460 KB Output is correct
9 Correct 6 ms 416 KB Output is correct
10 Correct 6 ms 424 KB Output is correct
11 Correct 5 ms 332 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 460 KB Output is correct
14 Correct 5 ms 392 KB Output is correct
15 Correct 5 ms 460 KB Output is correct
16 Correct 5 ms 316 KB Output is correct
17 Correct 6 ms 288 KB Output is correct
18 Correct 6 ms 332 KB Output is correct
19 Execution timed out 3082 ms 2992 KB Time limit exceeded
20 Halted 0 ms 0 KB -