# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
841504 | 2023-09-01T15:50:40 Z | CBNK30_theviet | A Plus B (IOI23_aplusb) | C++17 | 0 ms | 0 KB |
#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; }