# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1023668 | vjudge1 | Just Long Neckties (JOI20_ho_t1) | C++17 | 0 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define f first
#define s second
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
using namespace std;
const int mod = 998244353;
void solve() {
int n;
cin >> n;
vector<int> v(n + 1);
vector<int> a1(n);
for (int i = 0; i <= n; i++) {
cin >> v[i];
}
for (int i = 0; i < n; i++) {
cin >> a1[i];
}
vector<int> ans;
sort(a1.begin(), a1.end());
for (int i = 0; i <= n; i++) {
int mx = 0;
vector<int> v1;
for (int j = 0; j <= n; j++) {
if (j == i) {
continue;
}
v1.pb(v[j]);
}
sort(v1.begin(), v1.end());
for (int j = 0; j < n; j++) {
mx = max(mx, abs(v1[j] - a1[j]));
}
ans.pb(mx);
}
for (int i = 0; i < ans.size(); i++) {
cout << ans[i] << " ";
}
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
//cin >> t;
while (t--) {
solve();
}
}
컴파일 시 표준 에러 (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... |