Submission #809221

#TimeUsernameProblemLanguageResultExecution timeMemory
809221HaroldVemenoMeasures (CEOI22_measures)C++17
0 / 100
1575 ms1416 KiB
#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)

Main.cpp: In function 'void solve()':
Main.cpp:34:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |         for(int j = 1; j < as.size(); ++j) {
      |                        ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...