// ███╗ ███╗ █████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ ███╗ ███╗ █████╗ ██████╗ ██████╗██╗ ██╗███████╗██╗ ██╗ ██╗ ██╗██╗██╗
// ████╗ ████║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗╚██╗ ██╔╝██╗ ████╗ ████║██╔══██╗██╔══██╗██╔════╝██║ ██║██╔════╝██║ ██║ ██║ ██║██║██║
// ██╔████╔██║███████║██║ ██║█████╗ ██████╔╝ ╚████╔╝ ╚═╝ ██╔████╔██║███████║██████╔╝██║ ███████║█████╗ ██║ ██║ ███████║██║██║
// ██║╚██╔╝██║██╔══██║██║ ██║██╔══╝ ██╔══██╗ ╚██╔╝ ██╗ ██║╚██╔╝██║██╔══██║██╔══██╗██║ ██╔══██║██╔══╝ ██║ ██║ ██╔══██║██║██║
// ██║ ╚═╝ ██║██║ ██║██████╔╝███████╗ ██████╔╝ ██║ ╚═╝ ██║ ╚═╝ ██║██║ ██║██║ ██║╚██████╗██║ ██║███████╗███████╗███████╗█████╗██║ ██║██║██║
// ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚════╝╚═╝ ╚═╝╚═╝╚═╝
// ඞ
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣤⣤⣤⣤⣤⣤⣤⣄⡀
// ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⡿⠛⠉⠉⠉⠉⠉⠉⠻⢿⣿⣷⡄
// ⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⠋⠀⠀⠀⠀⠀⠀⠀ ⢻⣿⣿⡄
// ⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⠀ ⣠⣾⣿⣿⣿⠿⠿⠿⢿⣿⣿⣄
// ⠀⠀⠀⠀⠀⠀⠀⣿⣿⠁⠀⠀ ⣿⣿⣯⠁⠀⠀⠀⠀⠀ ⠙⢿⣷⡄
// ⠀⠀⣀⣤⣴⣶⣶⣿⡟⠀⠀⠀ ⣿⣿⣿ ⣿⣷
// ⠀⢰⣿⡟⠋⠉⣹⣿⡇⠀⠀⠀ ⣿⣿⣿⣷⣦⣀⣀⣀⣀⣀⣀⣀⣿⣿
// ⢸⣿⡇ ⣿⣿⡇⠀⠀ ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
// ⣸⣿⡇ ⣿⣿⡇⠀⠀⠀⠀ ⠉⠉⠉⠉⠉⠉⠉⠉⠉⡿⢻⡇
// ⠀⣿⣿ ⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⡇
// ⠀⣿⣿⠀ ⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⡇
// ⠀⣿⣿⠀⠀ ⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⡇
// ⠀⢿⣿ ⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣿⡇
// ⠀⠸⣿⣦⡀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣿⣿
// ⠀⠀⠛⢿⣿⣿⣿⣿⡇ ⠀⣠⣿⣿⣿⣿⣄ ⣿⣿
// ⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⣽⣿⡆ ⢸⣿⡇
// ⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⢹⣿⡆⠀⠀ ⣸⣿⠇
// ⠀⠀⠀⠀⠀⠀⠀⢿⣿⣦⣄⣀⣠⣴⣿⣿ ⠀⠈⠻⣿⣿⣿⣿⡿⠏
// ⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⠿⠿⠿⠿⠋⠁
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define plll pair<pll, pll>
#define pdd pair<double, double>
#define pu push_back
#define po pop_back
#define fi first
#define se second
#define fifi fi.fi
#define fise fi.se
#define sefi se.fi
#define sese se.se
#define cekcek cout<<'c'<<'e'<<'k'<<endl
using namespace std;
ll N, K, A[150005], B[150005], pos, sum, j;
bool ya;
int main(){
ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
cin >> N >> K;
for(ll i = 1; i <= N + K; i++){
cin >> A[i];
if(i > 1) B[i - 1] = A[i] - A[i - 1];
}
if(K == 1){
pos = -1;
for(ll i = 1; i < N + K - 1; i++){
if(i == (N + K - 1) / 2) continue;
if(B[i] + B[i + 1] == B[N + K - i]){
pos = i + 1;
break;
}
}
if(pos == -1){
//anggap A[1] salah
ya = true;
sum = A[2] + A[N + K];
j = N;
for(ll i = 3; i < j; i++){
if(sum != A[i] + A[j]){
ya = false;
break;
}
j--;
}
if(ya) pos = 1;
else{
//anggap A[N + 1] salah
ya = true;
sum = A[1] + A[N];
j = N - 1;
for(ll i = 2; i < j; i++){
if(sum != A[i] + A[j]){
ya = false;
break;
}
j--;
}
if(ya) pos = N + 1;
else pos = N / 2 + 1;
}
}
for(ll i = 1; i <= N; i++){
if(pos != i) cout << A[i] << " ";
}
}
}
# | 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... |