# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1081587 | vjudge1 | Measures (CEOI22_measures) | C++17 | 1569 ms | 1028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
//#define int long long
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;
const int mod = 1e9 + 7;
const int LOG = 20;
const int maxn = 1e5 + 5;
signed main() {
ll n, m, d;
cin >> n >> m >> d;
vector<ll> a(n);
for(ll &x : a) cin >> x;
sort(a.begin(), a.end());
while(m--) {
ll x;
cin >> x;
a.push_back(x);
sort(a.begin(), a.end());
ll ans = 0;
vector<ll> vec; vec.push_back(-1e18);
for(ll &x : a) vec.push_back(x);
for(int i=1; i<vec.size(); i++) {
if(vec[i] - vec[i-1] < d) ans = max(ans, vec[i-1] - vec[i] + d);
vec[i] = max(vec[i-1] + d, vec[i]);
}
cout << (long double)ans / 2 << " ";
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |