제출 #701996

#제출 시각아이디문제언어결과실행 시간메모리
701996WeberChangJust Long Neckties (JOI20_ho_t1)C++14
9 / 100
1043 ms11652 KiB
#include <bits/stdc++.h> #define FastIO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll unsigned long long #define MAX 200005 using namespace std; int n, A[MAX], B[MAX], ans; set<int> ASet; void solve() { cin >> n; for (int i = 0; i <= n; i++) { cin >> A[i]; ASet.insert(A[i]); } for (int i = 0; i < n; i++) cin >> B[i]; sort(B, B + n); for (int i = 0; i <= n; i++) { ans = 0; ASet.erase(A[i]); int j = 0; for (auto it : ASet) { ans = max(ans, max(0, it - B[j])); j++; } cout << ans << " "; ASet.insert(A[i]); } } int main() { FastIO solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...