# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
809225 | HaroldVemeno | Measures (CEOI22_measures) | C++17 | 148 ms | 6220 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];
if(m <= 10) {
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 << time/2;
if(time&1) cout << ".5";
cout << ' ';
}
} else if(n == 0) {
ll time = 0;
ll b = bs[0];
cout << 0 << ' ';
for(int i = 1; i < m; ++i) {
time = max(time, 0ll+d-bs[i]+b);
b = max(b+d, 1ll*bs[i]);
cout << time/2;
if(time&1) cout << ".5";
cout << ' ';
}
}
cout << '\n';
return;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed;
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... |