Shower Line
来源:互联网 发布:双硬盘ubuntu安装win10 编辑:程序博客网 时间:2024/05/17 05:43
http://codeforces.com/problemset/problem/431/B
5!=120 暴力
#include <iostream>#include <algorithm>using namespace std;int a[6][6];int b[6]={0,1,2,3,4,5};int main(){while(cin>>a[1][1]) { for(int i=2;i<=5;i++) cin>>a[1][i]; for(int i=2;i<=5;i++) for(int j=1;j<=5;j++) cin>>a[i][j]; int max=-1; int sum; do { sum=a[b[1]][b[2]]+a[b[2]][b[1]]+a[b[3]][b[4]]+a[b[4]][b[3]]; sum+=a[b[2]][b[3]]+a[b[3]][b[2]]+a[b[4]][b[5]]+a[b[5]][b[4]]; sum+=a[b[3]][b[4]]+a[b[4]][b[3]]; sum+=a[b[4]][b[5]]+a[b[5]][b[4]]; if(sum>max) max=sum; } while(next_permutation(b+1,b+6)); cout<<max<<endl; } return 0;}
0 0
- Shower Line
- B. Shower Line
- codeforces 431B - Shower Line
- Codeforces 431B Shower Line
- codeforces 431B Shower Line
- codeforces 431B Shower Line
- Codeforces #247 (Div. 2) B. Shower Line
- codeforces#247_div2_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(简单模拟)
- Meteor Shower
- POJ3669Meteor Shower
- bfs_poj_3669_Meteor Shower
- Meteor Shower
- poj3669Meteor Shower
- Meteor Shower
- LINE
- Android事件分发机制之ViewGroup篇
- 内存管理
- 51Nod 1001 数组中和等于K的数对
- Bootstrap实现自定义进度条
- 【郑轻】[1799]wrz的压岁钱
- Shower Line
- Hibernate入口之Configuration
- Android反编译
- 用算法计算出算术表达式:(56-20)/(4+2)的值
- 诺斯悖论
- java用Socket实现的远程桌面浏览&n…
- React-Native频繁修改IP,烦吗
- UIVIewController自定义切换效果
- Java中数据输入输出流——DataInputS…