codeforces 431B Shower Line
来源:互联网 发布:网上看房用什么软件 编辑:程序博客网 时间:2024/04/30 08:15
#include <cstdio>
#include <algorithm>using namespace std;
int main()
{
int h[6]={0,1,2,3,4,5};
int a[6][6];
int i,max,sum;
while(~scanf("%d%d%d%d%d",&a[1][1],&a[1][2],&a[1][3],&a[1][4],&a[1][5]))
{
for(i=2;i<=5;i++)
scanf("%d%d%d%d%d",&a[i][1],&a[i][2],&a[i][3],&a[i][4],&a[i][5]);
max=0;
do
{
sum=a[h[1]][h[2]]+a[h[2]][h[1]]+a[h[3]][h[4]]+a[h[4]][h[3]];
sum+=a[h[2]][h[3]]+a[h[3]][h[2]]+a[h[4]][h[5]]+a[h[5]][h[4]];
sum+=a[h[3]][h[4]]+a[h[4]][h[3]]+a[h[4]][h[5]]+a[h[5]][h[4]];
if(sum>max)
max=sum;
}while(next_permutation(h+1,h+6));
printf("%d\n",max);
}
return 0;
}
1 0
- codeforces 431B - Shower Line
- Codeforces 431B Shower Line
- codeforces 431B Shower Line
- codeforces 431B Shower Line
- Codeforces #247 (Div. 2) B. Shower Line
- B. Shower Line
- Codeforces Round #247(Div. 2) B. Shower Line 暴力
- Codeforces Round #247 (Div. 2)a.Black Square,b.Shower Line,c.k-Tree前三题
- Codeforces Round #247 (Div. 2) B. Shower Line(简单模拟)
- codeforces#247_div2_B Shower Line 暴力
- Shower Line
- CodeForces 319B Psychos in a Line
- Codeforces 319B. Psychos in a Line【栈】
- CodeForces 319B-Psychos in a Line(单调队列)
- Codeforces Round #189 (Div. 1) B. Psychos in a Line
- 【模拟】Codeforces 710B Optimal Point on a Line
- codeforces 710B - Optimal Point on a Line
- Codeforces 710B-Optimal Point on a Line
- 保罗·格雷厄姆创业讲堂二:团队与执行
- 解决java中ZipFile解压缩时候的中文路径和乱码问题
- scikit-learn使用joblib持久化模型过程中的问题详解
- shell资料
- Core Data结构修改,升级,迁移,后,在AppStore中更新升级crash的问题.
- codeforces 431B Shower Line
- 第9周项目1-利用循环程序求和B
- AIX上Sybase15的安装
- cocos2dx A* + tiledMap(改良升级)
- Matlab之BP神经网络反向传播算法
- poj2243 hdu1372 floyid warshall
- 大学规划
- ios 如何获取不变的UDID
- ubuntu 上安装 SDL