# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
625118 | Abrar_Al_Samit | Group Photo (JOI21_ho_t3) | C++17 | 5064 ms | 58264 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |