#include <bits/stdc++.h>
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define MAX 5e4 + 1
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sec second
#define fi first
#define elif else if
#define print(k) cerr << "Ans : "; cout << k << endl;
#define int ll
#define ask(a, b) cout << "? " << a << " " << b << endl;
#define ins insert
typedef long long ll;
typedef unsigned long long ull;
const int oo = INT_MAX;
const int ooo = 0x3F3F3F3F3F3F3F3FLL;
const int mod = 301907;
using namespace std;
void solve()
{
int n, k;
cin >> n >> k;
vector<int> v(n+1);
for(int i = 0; i<n+1; i++)
{
cin >> v[i];
}
for(int i = 0; i<n+1; i++)
{
vector<int> arr;
for(int j = 0; j<n+1; j++)
{
if(i==j)continue;
arr.pb(v[j]);
}
int c = 0;
for(int i = 0; i<n/2; i++)
{
if(arr[i] + arr[n-i-1] != arr[i+1] + arr[n-i-2])
{
c = 1;
break;
}
}
if(c == 0)
{
for(int i : arr)cout << i << " ";
return;
}
}
}
int32_t main()
{
OPT
int t = 1;
//cin >> t;
while(t--)
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
15 ms |
340 KB |
Output is correct |
3 |
Correct |
14 ms |
388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1395 ms |
1096 KB |
Output is correct |
2 |
Correct |
28 ms |
5684 KB |
Output is correct |
3 |
Execution timed out |
3073 ms |
6444 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
4300 KB |
Output is correct |
2 |
Execution timed out |
3055 ms |
6716 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
14 ms |
340 KB |
Unexpected end of file - int32 expected |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
3071 ms |
6456 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
3076 ms |
6464 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |