# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
626456 | Abrar_Al_Samit | Just Long Neckties (JOI20_ho_t1) | C++17 | 1087 ms | 4760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
void PlayGround() {
int n;
cin>>n;
vector<pair<int,int>>a(n+1);
for(int i=0; i<n+1; i++) {
cin>>a[i].first;
a[i].second = i;
}
sort(a.begin(), a.end());
int b[n];
for(int i=0; i<n; ++i) {
cin>>b[i];
}
sort(b, b+n);
int ans[n+1] = {0};
int pre[n+1] = {0}, suf[n+1] = {0};
for(int i=0; i<n; ++i) {
int strangeness = max(0, a[i+1].first-b[i]);
for(int j=0; j<=i; ++j) {
ans[a[j].second] = max(ans[a[j].second], strangeness);
}
strangeness = max(0, a[i].first-b[i]);
for(int j=i+1; j<n+1; ++j) {
ans[a[j].second] = max(ans[a[j].second], strangeness);
}
}
for(int i=0; i<n+1; ++i) {
cout<<ans[i]<<' ';
}
cout<<'\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
PlayGround();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |