fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. int inf = 1e18;
  5. signed main()
  6. {
  7. int n, m, k;
  8. cin>>n>>m>>k;
  9. int arr[101];
  10. for(int a=1; a<=n; a++)
  11. {
  12. cin>>arr[a];
  13. }
  14. int cost[101][101];
  15. for(int a=1; a<=n; a++)
  16. {
  17. for(int b=1; b<=m; b++)
  18. {
  19. cin>>cost[a][b];
  20. }
  21. }
  22. int dp[101][101][101];
  23. for(int a=0; a<=n; a++)
  24. {
  25. for(int b=0; b<=m; b++)
  26. {
  27. for(int c=0; c<=k; c++)
  28. {
  29. dp[a][b][c] = inf;
  30. }
  31. }
  32. }
  33. if(arr[1] == 0)
  34. {
  35. for(int a=1; a<=m; a++)
  36. {
  37. dp[1][a][1] = cost[1][a];
  38. }
  39. }
  40. else
  41. dp[1][arr[1]][1] = 0;
  42. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty