# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
809221 | HaroldVemeno | Measures (CEOI22_measures) | C++17 | 1575 ms | 1416 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#ifdef GUDEB
#define D(x) cerr << #x << ": " << (x) << '\n';
#define ifdeb if(true)
#else
#define D(x) ;
#define ifdeb if(false)
#endif
#define all(x) begin(x), end(x)
using namespace std;
using ull = unsigned long long;
using ll = long long;
// #define int ll;
int n, m, d;
vector<int> as;
vector<int> bs;
void solve() {
cin >> n >> m >> d;
as.resize(n);
bs.resize(m);
for(int i = 0; i < n; ++i) cin >> as[i];
for(int i = 0; i < m; ++i) cin >> bs[i];
for(int i = 0; i < m; ++i) {
as.push_back(bs[i]);
sort(all(as));
ll time = 0;
ll b = as[0];
for(int j = 1; j < as.size(); ++j) {
time = max(time, 0ll+d-as[j]+b);
b = max(b+d, 1ll*as[j]);
}
cout << 1.0*time/2 << ' ';
}
cout << '\n';
return;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}
Compilation message (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... |