Submission #506205

# Submission time Handle Problem Language Result Execution time Memory
506205 2022-01-11T21:07:26 Z colossal_pepe Fortune Telling 2 (JOI14_fortune_telling2) C++17
4 / 100
3000 ms 1860 KB
#include <iostream>
#include <vector>
using namespace std;

int n, k;
vector<int> a, b, t;

int main() {
	cin >> n >> k;
	a.resize(n), b.resize(n);
	t.resize(k);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}
	for (int i = 0; i < k; i++) {
		cin >> t[i];
	}
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		int upside = 0;
		for (int j = 0; j < k; j++) {
			int x;
			if (upside % 2 == 0) x = a[i];
			else x = b[i];
			if (x <= t[j]) upside++;
		}
		if (upside % 2 == 0) ans += a[i];
		else ans += b[i];
	}
	cout << ans << endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 4 ms 304 KB Output is correct
3 Correct 4 ms 332 KB Output is correct
4 Correct 4 ms 292 KB Output is correct
5 Correct 5 ms 332 KB Output is correct
6 Correct 4 ms 332 KB Output is correct
7 Correct 5 ms 332 KB Output is correct
8 Correct 4 ms 304 KB Output is correct
9 Correct 2 ms 204 KB Output is correct
10 Correct 3 ms 204 KB Output is correct
11 Correct 4 ms 332 KB Output is correct
12 Correct 4 ms 332 KB Output is correct
13 Correct 5 ms 328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 4 ms 304 KB Output is correct
3 Correct 4 ms 332 KB Output is correct
4 Correct 4 ms 292 KB Output is correct
5 Correct 5 ms 332 KB Output is correct
6 Correct 4 ms 332 KB Output is correct
7 Correct 5 ms 332 KB Output is correct
8 Correct 4 ms 304 KB Output is correct
9 Correct 2 ms 204 KB Output is correct
10 Correct 3 ms 204 KB Output is correct
11 Correct 4 ms 332 KB Output is correct
12 Correct 4 ms 332 KB Output is correct
13 Correct 5 ms 328 KB Output is correct
14 Correct 328 ms 680 KB Output is correct
15 Correct 1219 ms 1192 KB Output is correct
16 Correct 2728 ms 1492 KB Output is correct
17 Execution timed out 3076 ms 1860 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 4 ms 304 KB Output is correct
3 Correct 4 ms 332 KB Output is correct
4 Correct 4 ms 292 KB Output is correct
5 Correct 5 ms 332 KB Output is correct
6 Correct 4 ms 332 KB Output is correct
7 Correct 5 ms 332 KB Output is correct
8 Correct 4 ms 304 KB Output is correct
9 Correct 2 ms 204 KB Output is correct
10 Correct 3 ms 204 KB Output is correct
11 Correct 4 ms 332 KB Output is correct
12 Correct 4 ms 332 KB Output is correct
13 Correct 5 ms 328 KB Output is correct
14 Correct 328 ms 680 KB Output is correct
15 Correct 1219 ms 1192 KB Output is correct
16 Correct 2728 ms 1492 KB Output is correct
17 Execution timed out 3076 ms 1860 KB Time limit exceeded
18 Halted 0 ms 0 KB -