Submission #1024876

#TimeUsernameProblemLanguageResultExecution timeMemory
1024876ZicrusMeetings (IOI18_meetings)C++17
4 / 100
5588 ms1116 KiB
#include <bits/stdc++.h> #include "meetings.h" using namespace std; typedef long long ll; vector<ll> minimum_costs(vector<int> h, vector<int> l, vector<int> r) { ll n = h.size(), q = l.size(); vector<ll> res; if (true) { for (int q1 = 0; q1 < q; q1++) { ll mnSum = 1ll << 62ll; for (int c = l[q1]; c <= r[q1]; c++) { ll sum = 0; int mx = 0; for (int i = c; i >= l[q1]; i--) { mx = max(mx, h[i]); sum += mx; } mx = h[c]; for (int i = c + 1; i <= r[q1]; i++) { mx = max(mx, h[i]); sum += mx; } mnSum = min(mnSum, sum); } res.push_back(mnSum); } return res; } return res; }

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:8:8: warning: unused variable 'n' [-Wunused-variable]
    8 |     ll n = h.size(), q = l.size();
      |        ^
#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...