# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
841504 | CBNK30_theviet | A Plus B (IOI23_aplusb) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fileio freopen(VietWasHere".inp", "r", stdin); freopen(VietWasHere".out", "w", stdout);
#define getbit(i, j) ((i >> (j)) & 1)
#define cntbit(x) (__builtin_popcountll(x))
#define ll long long
#define pb push_back
#define sz(x) x.size()
#define all(x) x.begin(), x.end()
#define VietWasHere "khongon"
#define mxn 100005
using namespace std;
using str = string; // Yes, python go brrr
using vi = vector<int>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
const ll INFLL = 1e18;
int n, a[mxn], b[mxn];
vector<int> g;
signed main()
{
fastio;
// fileio;
/* Here we go */
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
for(int j = 1; j <= n; j++) cin >> b[j];
g.pb(a[1] + b[1]);
for(int i = 2; i <= n; i++) g.pb(a[i] + b[1]);
for(int j = 2; j <= n; j++) g.pb(b[j] + a[1]);
sort(all(g));
for(int i = 0; i < n; i++) cout << g[i] << ' ';
return 0;
}