Submission #1024874

#TimeUsernameProblemLanguageResultExecution timeMemory
1024874ZicrusMeetings (IOI18_meetings)C++17
0 / 100
0 ms348 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 = 1 << 62; 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:12:26: warning: left shift count >= width of type [-Wshift-count-overflow]
   12 |             ll mnSum = 1 << 62;
      |                        ~~^~~~~
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...