# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
203930 | Segtree | Fireworks (APIO16_fireworks) | C++14 | 24 ms | 1144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
#define N 310
ll n,m;
vector<pair<ll,ll> > g[N];
ll dp[N][N];
void dfs(ll x){
if(x>n){
rep(i,N)dp[x][i]=1e9;
dp[x][0]=0;
return;
}
rep(i,N)dp[x][i]=0;
for(auto e:g[x]){
dfs(e.first);
rep(i,N){
ll mi=1e9;
for(int j=0;j<=i;j++){
chmin(mi,dp[e.first][j]+abs((i-j)-e.second));
}
dp[x][i]+=mi;
}
# | 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... |