제출 #1023646

#제출 시각아이디문제언어결과실행 시간메모리
1023646vjudge1Just Long Neckties (JOI20_ho_t1)C++17
9 / 100
1059 ms10680 KiB
#include "bits/stdc++.h" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> #define nemeshay ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define allr(pon) pon.rbegin(), pon.rend() #define all(pon) pon.begin(), pon.end() #define nosolve cout << "-1\n" #define YES cout << "YES\n" #define Yes cout << "Yes\n" #define pii pair <int, int> #define OK cout << "OK\n" #define Ok cout << "Ok\n" #define NO cout << "NO\n" #define No cout << "No\n" #define pf push_front #define int long long #define pb push_back #define sigma signed #define sc second #define fr first using namespace __gnu_pbds; using namespace std; const int N = 1e6 + 20, INF = 1e16 + 7; int a[N], b[N]; sigma main(){ nemeshay int n; cin >> n; for (int i = 0; i <= n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; sort (b, b + n); for (int i = 0; i <= n; i++) { int mx = 0; vector <int> pon; map <int, bool> nepon; for (int j = 0; j <= n; j++) if (j != i) pon.pb(a[j]); sort (pon.begin(), pon.end()); for (int j = 0; j < n; j++) mx = max(mx, pon[j] - b[j]); cout << mx << ' '; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...