Submission #1105765

# Submission time Handle Problem Language Result Execution time Memory
1105765 2024-10-27T17:03:41 Z vjudge1 Kitchen (BOI19_kitchen) C++17
0 / 100
1 ms 592 KB
#include <bits/stdc++.h>

int main() {
    std::ios_base::sync_with_stdio(false); 
    std::cin.tie(nullptr);

    int n, m, k;
    std::cin >> n >> m >> k;
    std::vector<int> a(n), b(m);
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    for (int i = 0; i < m; i++) {
        std::cin >> b[i];
    }
    int64_t sum = 0;
    for (int i = 0; i < m; i++) {
        sum += b[i];
    }
    if (k == 1) {
        int64_t suma = 0;
        for (int i = 0; i < n; i++) {
            suma += a[i];
        }
        if (sum < suma) {
            std::cout << "Impossible\n";
            return 0;
        }
        std::cout << sum - suma << "\n";
        return 0;
    }
    assert(false);
    return 0;
}


# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 592 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -