# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
789463 | Acanikolic | Just Long Neckties (JOI20_ho_t1) | C++14 | 1065 ms | 10696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define pb push_back
#define F first
#define S second
using namespace std;
const long long N = 2e5+10;
const long long mod = 1e9+7;
const long long inf = 1e18;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int>a(n+2),b(n+1);
for(int i=1;i<=n+1;i++) cin >> a[i];
for(int i=1;i<=n;i++) cin >> b[i];
sort(b.begin()+1,b.end());
for(int i=1;i<=n+1;i++) {
int res = 0,ptr = 1;
vector<int>V;
V.pb(0);
for(int j=1;j<i;j++) V.pb(a[j]);
for(int j=i+1;j<=n+1;j++) V.pb(a[j]);
sort(V.begin()+1,V.end());
for(int j=1;j<=n;j++) res = max(res,max(0ll,V[j]-b[j]));
cout << res << ' ';
}
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... |