mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-01-11 16:31:58 +00:00
P1359 租用游艇
R41199618
This commit is contained in:
parent
e441db636c
commit
f590742cf9
22
problem/P1359/P1359.cpp
Normal file
22
problem/P1359/P1359.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n, t, a[205][205], f[205];
|
||||
cin >> n;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
for (int j = i + 1; j <= n; j++) {
|
||||
cin >> a[i][j];
|
||||
}
|
||||
f[i] = 0x3f3f3f;
|
||||
}
|
||||
f[n] = 0;
|
||||
for (int i = n-1; i >= 0; i--) {
|
||||
for (int j = i + 1; j <= n; j++) {
|
||||
f[i] = min(f[i], f[j] + a[i][j]);
|
||||
}
|
||||
}
|
||||
cout << f[1] << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user