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 <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define pii pair<int, int>
vector<vector<int>>vec;
vector<bool>visit;
int main() {
int n, k;
cin >> n >> k;
vector<int>vec(n+k);
for (int i = 0; i < n + k; i++) {
cin >> vec[i];
}
for (int i = 0; i < n + k; i++) {
vector<int>tmp(0);
for (int j = 0; j < n + k; j++) {
if (j != i) {
tmp.push_back(vec[j]);
}
}
int tmp2 = tmp[0]+tmp[n-1];
bool flag = true;
for (int j = 1; j <=n/2-1; j++) {
if (tmp[j]+tmp[n-1-j] != tmp2) {
flag = false;
break;
}
}
if (flag) {
for (int j = 0; j < n; j++)
cout << tmp[j] << " ";
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... |