@[Zyh110113](/user/976369) 读入
by Zcras @ 2023-07-03 12:49:29
啊啊啊拜托你用for循环啊看不下去啊!!!其实用while也可以【滑稽】
代码(本人的)
```cpp
#include<bits/stdc++.h>
using namespace std;
int n, i, j, l, k, x, y, s;
int d[55][55], f[55][55][55][55];
int main()
{
cin>>n;
while(cin>>x>>y>>s && x)
d[x][y] = s;
for(i = 1; i <= n; i++)
for(j = 1; j <= n; j++)
for(l = 1; l <= n; l++)
for(k = 1; k <= n; k++)
{
f[i][j][l][k] = max(max(f[i - 1][j][l - 1][k], f[i][j - 1][l][k-1]), max(f[i - 1][j][l][k - 1], f[i][j - 1][l - 1][k])) + d[i][j];
if(i != 1 && j != k) f[i][j][l][k] += d[l][k];
}
printf("%d", f[n][n][n][n]);
return 0;
}
```
by water8424 @ 2023-07-03 13:06:36
谢谢,已更正,过了我的第一道绿题!
```cpp
include <iostream>
using namespace std;
int main()
{
cout<<"谢谢大佬";
}
```
by Zyh110113 @ 2023-07-03 15:35:06
@[Zyh110113](/user/976369)
```
include <iostream>
```
CE
by OIer_MF @ 2023-07-22 08:51:23
```
#呢
```
by OIer_MF @ 2023-07-22 08:51:48