# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
202047 | khohko | Just Long Neckties (JOI20_ho_t1) | C++17 | 501 ms | 17932 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ARRS ((ll)(4e5+100))
#define fr first
#define sc second
#define pb push_back
#define MX ((ll)(1e9+100))
#define MAX ((ll)(1e18+100))
ll n;
pair<ll,ll> a[ARRS];
ll b[ARRS];
ll ans[ARRS];
int main(){
cin>>n;
for(int i=0; i<=n; i++){
cin>>a[i].fr;
a[i].sc=i;
}
for(int i=0; i<n; i++){
cin>>b[i];
}
sort(a,a+n+1);
sort(b,b+n);
multiset<ll> st;
for(int i=0; i<n; i++)
st.insert(a[i].fr-b[i]);
for(int i=n; i>=0; i--){
ans[a[i].sc]=*(--st.end());
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |