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

#TimeUsernameProblemLanguageResultExecution timeMemory
139941almogwaldMeetings (IOI18_meetings)C++14
19 / 100
5570 ms756348 KiB
#include <utility> #include <algorithm> #include <math.h> #include <vector> #include <set> #include <iostream> //#include "job.h" #include "meetings.h" #define fori(i,n) for(int i=0;i<n;i++) #define forn(i,n) for(int i=1;i<n;i++) #define fort(i,m,n) for(int i=m;i<n;i++) #define forib(i,n) for(int i=n-1;i>=0;i--) #define fornb(i,n) for(int i=n-1;i>0;i--) #define maxl 1e18 #define con continue; typedef long long lol; using namespace std; typedef vector<int> veci; typedef vector<lol> vecl; typedef pair<lol,lol> point; lol sum=0; vecl minimum_costs(veci H, veci L,veci R) { int n=H.size(); vector<veci> a(n,veci(n)); vector<vecl> b(n,vecl(n+1)); fori(i,n){ a[i][i]=H[i]; forib(j,i){ a[i][j]=max(a[i][j+1],H[j]); } fort(j,i+1,n){ a[i][j]=max(a[i][j-1],H[j]); } fori(j,n){ b[i][j+1]=b[i][j]+a[i][j]; } } int Q = L.size(); vector<long long> C(Q); for (int j = 0; j < Q; ++j) { C[j]=maxl; fort(i,L[j],R[j]+1){ C[j]=min(C[j],b[i][R[j]+1]-b[i][L[j]]); } } return C; }
#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...