# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
969454 | efedmrlr | Measures (CEOI22_measures) | C++17 | 1566 ms | 5468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long int
#define ld long double
#define pb push_back
#define MP make_pair
#define all(x) x.begin(), x.end()
#define rall(x) x.begin(), x.end()
#define REP(i, n) for(int i = 0; (i) < (n); (i)++)
using namespace std;
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
const int N = 2e5 + 5;
const int INF = 1e17;
int D;
void solve() {
int n, m;
cin >> n >> m >> D;
vector<int> a(n);
REP(i, n) cin >> a[i];
for(int z = 0; z < m; z++) {
int b;
cin >> b;
a.pb(b);
sort(all(a));
int v = 0;
for(int i = 0; i < a.size(); i++) {
for(int j = i + 1; j < a.size(); j++) {
v = max(v, (a[i] - i * D) - (a[j] - j * D));
}
}
if(v & 1) {
cout << v / 2 << ".5 ";
}
else {
cout << v / 2 << " ";
}
}
cout << "\n";
}
signed main() {
fastio();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |