| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 762927 | vjudge1 | Just Long Neckties (JOI20_ho_t1) | C++17 | 88 ms | 7876 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
pair<int, int> a[200002];
int b[200002], diff1[200005], diff2[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
for(int i = 1; i <= n+1; i++){
cin>>a[i].first;
a[i].second = i;
}
for(int i = 1; i <= n; i++) cin>>b[i];
sort(a + 1, a + n + 2);
sort(b + 1, b + n + 1);
for(int i = 1; i <= n; i++){
diff1[i] = max(a[i].first - b[i], 0);
diff2[i] = max(a[i+1].first - b[i], 0);
diff1[i] = max(diff1[i], diff1[i-1]);
}
for(int i = n-1; i >= 1; i--) diff2[i] = max(diff2[i], diff2[i+1]);
vector<pair<int, int>> ans;
for(int i = 1; i <= n+1; i++){
ans.push_back(make_pair(a[i].second, max(diff1[i-1], diff2[i])));
}
sort(ans.begin(), ans.end());
for(int i = 0; i < ans.size(); i++) cout<<ans[i].second<<" ";
}
컴파일 시 표준 에러 (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... | ||||
