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>
using namespace std;
typedef long long ll;
#define ld long double
#define vf v[i].first
#define vs v[i].second
const ll MOD = 1e9 + 7;
void print(vector<ll> &v) {
for (auto c:v)
cout << c << " ";
}
vector<ll>e[2005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin >> n >> k;
vector<ll>v(n+k);
for (int i = 0; i < n+k; ++i)
cin >> v[i];
for (int i = 0; i < n+k; ++i) {
for (int j = 0; j < n+k; ++j) {
if (i!=j)
e[i].push_back(v[j]);
}
}
for (int i = 0; i < n+k; ++i) {
bool flag = true;
ll sum = e[i][0]+e[i][n-1];
for (int j = 1; j < n-1; ++j) {
if (e[i][j]+e[i][n-1-j]!=sum) {
flag = false;
break;
}
}
if (flag) {
print(e[i]);
break;
}
}
}
# | 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... |