Submission #567286

# Submission time Handle Problem Language Result Execution time Memory
567286 2022-05-23T10:00:40 Z haxorman Kitchen (BOI19_kitchen) C++14
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 307;

int a[mxN], b[mxN];

int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int n, m, k;
	cin >> n >> m >> k;
	
	if (m < k) {
		cout << "Impossible\n";
		exit(0);
	}
	
	int sum1 = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		sum1 += a[i];

		if (a[i] < k) {
			cout << "Impossible\n";
			exit(0);
		}
	}
	
	int sum2 = 0;
	for (int i = 0; i < m; ++i) {
		cin >> b[i];
		sum2 += b[i];
	}

	if (sum1 > sum2) {
		cout << "Impossible\n";
		exit(0);
	}
	
	cout << sum2 - sum1 << "\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -