Submission #625118

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6251182022-08-09 12:01:36Abrar_Al_SamitGroup Photo (JOI21_ho_t3)C++17
64 / 100
5064 ms58264 KiB
#include<bits/stdc++.h>
using namespace std;
const int MX = 5004;
int n;
int a[MX];
int cost[MX][MX];
int st[MX*4];
void upd(int l, int r, int id, int val, int v) {
if(l==r) {
st[v] = val;
return;
}
int mid = (l+r)/2;
if(id<=mid) upd(l, mid, id, val, v*2);
else upd(mid+1, r, id, val, v*2+1);
st[v] = st[v*2]+st[v*2+1];
}
int query(int l, int r, int L, int R, int v) {
if(l>=L && r<=R) return st[v];
if(l>R || r<L) return 0;
int mid = (l+r)/2;
return query(l, mid, L, R, v*2) + query(mid+1, r, L, R, v*2+1);
}
int dp[MX];
int solve(int i) {
if(i>n) return 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...