(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 #1111869

#TimeUsernameProblemLanguageResultExecution timeMemory
1111869epicci23Meetings (IOI18_meetings)C++17
19 / 100
736 ms786432 KiB
#include "bits/stdc++.h" #include "meetings.h" #define ll long long #define all(v) v.begin() , v.end() #define sz(a) (ll)a.size() using namespace std; const ll INF = 1e18; vector<long long> minimum_costs(vector<int> H, vector<int> L,vector<int> R){ ll n,q; n=sz(H),q=sz(L); ll ar[n+5]; for(int i=1;i<=n;i++) ar[i]=H[i-1]; ll mx[n+5][n+5]; for(int i=1;i<=n;i++){ ll hm = ar[i]; for(int j=i;j<=n;j++){ hm=max(hm,ar[j]); mx[i][j]=hm; } } ll pre[n+5][n+5]; memset(pre,0,sizeof(pre)); for(int i=1;i<=n;i++){ ll cur = 0; for(int j=i;j<=n;j++){ cur += mx[i][j]; pre[i][j] = cur; } cur = 0; for(int j=i;j>=1;j--){ cur += mx[j][i]; pre[i][j] = cur; } } vector<ll> res; for(int i=0;i<q;i++){ ll l,r; l=L[i]+1,r=R[i]+1; ll xd = INF; for(int i=l;i<=r;i++){ ll curi = pre[i][l] + pre[i][r] - ar[i]; xd = min(xd, curi); } res.push_back(xd); } return res; } /*void _(){ int n,q; cin >> n >> q; int ar[n+5]; for(int i=1;i<=n;i++) cin >> ar[i]; int mx[n+5][n+5]; for(int i=1;i<=n;i++){ int hm = ar[i]; for(int j=i;j<=n;j++){ hm=max(hm,ar[j]); mx[i][j]=hm; } } int pre[n+5][n+5]; memset(pre,0,sizeof(pre)); for(int i=1;i<=n;i++){ int cur = 0; for(int j=i;j<=n;j++){ cur += mx[i][j]; pre[i][j] = cur; } cur = 0; for(int j=i;j>=1;j--){ cur += mx[j][i]; pre[i][j] = cur; } } while(q--){ int l,r; cin >> l >> r; int res = INF; for(int i=l;i<=r;i++){ int curi = pre[i][l] + pre[i][r] - ar[i]; res = min(res, curi); } cout << res << '\n'; } } int32_t main(){ cin.tie(0); ios::sync_with_stdio(0); int tc=1;//cin >> tc; while(tc--) _(); return 0; }*/
#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...