This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAXN = 15e4 + 10;
int atual[MAXN];
int v[MAXN];
int resp[MAXN];
bool FoundResp = false;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, K;
cin >> N >> K;
for (int i = 1; i <= N + K; i++) cin >> v[i];
if (K == 1)
{
for (int fora = 1; fora <= N + K; fora++)
{
int soma1 = 0; int soma2 = 0;
for (int i = N+K; i >= 1; i--)
{
if (i == fora) continue;
if (soma1 < soma2) soma1 += v[i];
else soma2 += v[i];
}
if (soma1 == soma2)
{
for (int i = 1; i <= N + K; i++) if (i != fora) cout << v[i] << " ";
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |