Submission #723352

#TimeUsernameProblemLanguageResultExecution timeMemory
723352t_hollMeasures (CEOI22_measures)C++14
0 / 100
1571 ms312 KiB
#include <bits/stdc++.h> using namespace std; int N, M, D; double compute (vector<int> &res) { int ans = 0; sort(res.begin(), res.end()); for (int i = 0; i < res.size(); i ++) for (int j = i; j < res.size(); j ++) ans = max(ans, D * (j - i) - (res[j] - res[i])); return ((double) ans) / 2.0; } int main() { cin >> N >> M >> D; vector<int> res; for (int i = 0; i < N; i ++) { int x; cin >> x; res.push_back(x); } for (int i = 0; i < M; i ++) { int x; cin >> x; res.push_back(x); cout << compute(res) << " "; } cout << endl; return 0; }

Compilation message (stderr)

Main.cpp: In function 'double compute(std::vector<int>&)':
Main.cpp:11:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int i = 0; i < res.size(); i ++)
      |                     ~~^~~~~~~~~~~~
Main.cpp:12:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |         for (int j = i; j < res.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...