Submission #298783

#TimeUsernameProblemLanguageResultExecution timeMemory
298783Pichon5Meetings (IOI18_meetings)C++17
4 / 100
5575 ms1656 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; long long max(long long x, long long y){ if(x>y){ return x; } return y; } vector<long long> minimum_costs(vector<int> H,vector<int> L,vector<int> R) { vector<long long>v; for(int i=0;i<L.size();i++){ long long sum=1000000000000000; for(int l=L[i];l<=R[i];l++){ long long ma=0; long long res=0; for(int ii=l;ii<=R[i];ii++){ ma=max(ma,H[ii]); res+=ma; } ma=0; for(int ii=l-1;ii>=L[i];ii--){ ma=max(ma,H[ii]); res+=ma; } sum=min(sum,res); } v.push_back(sum); } return v; }

Compilation message (stderr)

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:12:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   for(int i=0;i<L.size();i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...