Submission #1320741

#TimeUsernameProblemLanguageResultExecution timeMemory
1320741mirasmKitchen (BOI19_kitchen)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define int long long

const int N = 10000 + 3; 


void fun () {  
	int n, k, m;
	cin >> n >> m >> k;
	vector<int> a(n + 1), b(m + 1);
	for (int i = 1; i <= n; i++) cin >> a[i];
	for (int i = 1; i <= m; i++) cin >> b[i];
	asssert(k == 1);	
	vector<int> dp(N);
	dp[0] = 1;
	for (int i = 1; i <= m; i++) {
		for (int j = N - 1; j >= b[i]; j--) {
			dp[j] |= dp[j - b[i]];
		}
	}

	int s = 0;
	for (int i = 1; i <= n; i++) {
		s += a[i];
	}

	for (int i = s; i < N; i++) {
		if (dp[i]) {
			cout << i - s << endl;
			return;
		}
	}
	cout << "Impossible";
}

signed main () {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int tt = 1;
        //cin >> tt;
        while (tt--) fun(); 
        return 0;

}



Compilation message (stderr)

kitchen.cpp: In function 'void fun()':
kitchen.cpp:14:9: error: 'asssert' was not declared in this scope; did you mean 'assert'?
   14 |         asssert(k == 1);
      |         ^~~~~~~
      |         assert