제출 #809225

#제출 시각아이디문제언어결과실행 시간메모리
809225HaroldVemenoMeasures (CEOI22_measures)C++17
59 / 100
148 ms6220 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]; 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(); }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'void solve()':
Main.cpp:35:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |             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...