(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1112360

#TimeUsernameProblemLanguageResultExecution timeMemory
1112360thelegendary08Meetings (IOI18_meetings)C++14
4 / 100
5569 ms2112 KiB
#include "meetings.h" #include<bits/stdc++.h> #define vi vector<int> #define vb vector<bool> #define vpii vector<pair<int,int>> #define pb push_back #define vvi vector<vector<int>> #define ll long long int #define f0r(i,n) for(int i = 0; i<n; i++) #define vout(v) for(auto u : v)cout<<u<<' '; cout<<'\n'; #define pii pair<int,int> using namespace std; std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { int q = L.size(); std::vector<long long> ans(q); vi v = H; f0r(i, q){ int l = L[i]; int r = R[i]; ll cur = 4e18; for(int j = l; j <= r; j++){ ll s = 0; int runmx = v[j]; for(int k = j; k >= l; k--){ runmx = max(runmx, v[k]); s += runmx; } runmx = v[j]; for(int k = j+1; k<=r; k++){ runmx = max(runmx, v[k]); s += runmx; } cur = min(cur,s); //cout<<s<<'\n'; } ans[i] = cur; } return ans; }
#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...