답안 #383661

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
383661 2021-03-30T13:34:55 Z nikatamliani Examination (JOI19_examination) C++14
2 / 100
3000 ms 1664 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5+10;
int x[N], y[N], a[N], b[N], c[N];
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int n, m;
	cin >> n >> m; 
	for (int i = 1; i <= n; ++i) {
		cin >> x[i] >> y[i];
	}
	for (int i = 1; i <= m; ++i) {
		cin >> a[i] >> b[i] >> c[i];
		if(a[i] + b[i] >= c[i]) {
			int ans = 0;
			for(int j = 1; j <= n; ++j) {
				if(x[j] >= a[i] && y[j] >= b[i]) {
					++ans;
				}
			}
			cout << ans << '\n';
			continue;
		}
		int all = 0, sumA = 0, sumB = 0;
		for(int j = 1; j <= n; ++j) {
			if(x[j] + y[j] >= c[i]) {
				++all;
			}
			if(x[j] < a[i] && x[j] + y[j] >= c[i]) {
				++sumA;
			}
			if(y[j] < b[i] && x[j] + y[j] >= c[i]) {
				++sumB;
			}
		}
		cout << all - sumA - sumB << '\n';
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 41 ms 492 KB Output is correct
8 Correct 41 ms 492 KB Output is correct
9 Correct 45 ms 492 KB Output is correct
10 Correct 42 ms 492 KB Output is correct
11 Correct 44 ms 492 KB Output is correct
12 Correct 41 ms 492 KB Output is correct
13 Correct 50 ms 620 KB Output is correct
14 Correct 48 ms 464 KB Output is correct
15 Correct 48 ms 492 KB Output is correct
16 Correct 30 ms 492 KB Output is correct
17 Correct 36 ms 492 KB Output is correct
18 Correct 13 ms 492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3043 ms 1664 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3043 ms 1664 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 41 ms 492 KB Output is correct
8 Correct 41 ms 492 KB Output is correct
9 Correct 45 ms 492 KB Output is correct
10 Correct 42 ms 492 KB Output is correct
11 Correct 44 ms 492 KB Output is correct
12 Correct 41 ms 492 KB Output is correct
13 Correct 50 ms 620 KB Output is correct
14 Correct 48 ms 464 KB Output is correct
15 Correct 48 ms 492 KB Output is correct
16 Correct 30 ms 492 KB Output is correct
17 Correct 36 ms 492 KB Output is correct
18 Correct 13 ms 492 KB Output is correct
19 Execution timed out 3043 ms 1664 KB Time limit exceeded
20 Halted 0 ms 0 KB -