Submission #865829

#TimeUsernameProblemLanguageResultExecution timeMemory
865829tolbiMeasures (CEOI22_measures)C++17
0 / 100
72 ms3408 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,k; cin>>n>>m>>k; vector<int> arr(n); vector<int> barr(m); for (int i = 0; i < n; ++i) { cin>>arr[i]; } for (int i = 0; i < m; ++i) { cin>>barr[i]; } int minel = -1; int maxel = -1; int crr = 0; function<void(int)> add = [&](int x)->void{ crr++; if (minel==-1) minel=x; if (maxel==-1) maxel=x; minel=min(minel,x); maxel=max(maxel,x); }; for (int i = 0; i < n; ++i) { add(arr[i]); } for (int i = 0; i < m; ++i) { add(barr[i]); int hh = (crr-1)*k-(maxel-minel); cout<<hh/2; if (hh%2) cout<<".5"; cout<<" "; } cout<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...