# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
586420 | krit3379 | Journey (NOI18_journey) | C++17 | 146 ms | 6456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define N 10005
int dp[405][N];
vector<pair<int,int>> g[N];
int main(){
int n,m,h,i,j,a,w;
scanf("%d %d %d",&n,&m,&h);
for(i=0;i<n-1;i++){
for(j=0;j<h;j++){
scanf("%d %d",&a,&w);
if(a<=i)continue;
g[i].push_back({a,w});
}
}
dp[0][0]=1;
for(j=0;j<m;j++){
for(i=0;i<n-1;i++){
dp[j+1][i]=min(dp[j+1][i]+dp[j][i],500000001);
for(auto [x,w]:g[i])if(j+w<m)dp[j+w][x]=min(dp[j+w][x]+dp[j][i],500000001);
}
}
for(i=0;i<m;i++)printf("%d ",dp[i][n-1]);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |