| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1133418 | Aviansh | Journey (NOI18_journey) | C++20 | 0 ms | 324 KiB |
#include <bits/stdc++.h>
using namespace std;
int mxval = 5e8+1;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n,m,h;
cin >> n >> m >> h;
long long ans[n][m];
for(int i = 0;i<n;i++){
fill(ans[i],ans[i]+m,0);
}
ans[0][0]=1;
for(int i = 0;i<n-1;i++){
for(int l = 0;l<h;l++){
int j,k;
cin >> j >> k;
if(j<i){
continue;
}
int temp = 0;
for(int d = 0;d<m-k;d++){
temp+=ans[i][d];
if(temp>=mxval){
temp=mxval;
}
ans[j][d+k]+=temp;
if(ans[j][d+k]>=mxval){
ans[j][d+k]=mxval;
}
}
}
}
int temp = 0;
for(int d = 0;d<m;d++){
temp=ans[n-1][d];
assert(temp<=mxval);
cout << temp << " ";
}
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... | ||||
