Submission #866887

#TimeUsernameProblemLanguageResultExecution timeMemory
866887sleepntsheepKitchen (BOI19_kitchen)C++17
0 / 100
0 ms348 KiB
#include <cstdio> #include <numeric> #include <cstdlib> #include <cstring> #include <cassert> #include <string> #include <deque> #include <vector> #include <map> #include <queue> #include <algorithm> #include <iostream> #include <utility> using namespace std; using ll = long long; using ld = long double; #define ShinLena cin.tie(nullptr)->sync_with_stdio(false) #define N 200005 #define ALL(x) x.begin(), x.end() int n, m, k, a[N], b[N]; void skull() { exit((cout << "Impossible", 0)); } int main() { ShinLena; cin >> n >> m >> k; if (m < k) skull(); for (int i = 0; i < n; ++i) { cin >> a[i]; if (a[i] < k) skull(); } for (int i = 0; i < m; ++i) cin >> b[i]; int bs = accumulate(b, b+m, 0), as = accumulate(a, a+n, 0); if (bs < as) skull(); cout << bs-as; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...