이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 << as - bs;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |