Codeforces Round #247 (Div. 2) B - Shower Line
模拟即可
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
vector<int> a();
for(int i = ; i < ; ++ i) a[i] = i;
int g[][];
for(int i = ; i < ; ++ i){
for(int j = ; j < ; ++ j){
cin >> g[i][j];
}
}
int maxHappiness = ;
do{
maxHappiness = max(g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]]+g[a[]][a[]],maxHappiness);
cout<<a[]<<a[]<<a[]<<a[]<<a[]<<endl;
cout<<maxHappiness<<endl; }while(next_permutation(a.begin(),a.end()));
cout<<maxHappiness<<endl; }
Codeforces Round #247 (Div. 2) B - Shower Line的更多相关文章
- Codeforces Round #247 (Div. 2) ABC
Codeforces Round #247 (Div. 2) http://codeforces.com/contest/431 代码均已投放:https://github.com/illuz/Wa ...
- Codeforces Round #247 (Div. 2) B
B. Shower Line time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- [Codeforces Round #247 (Div. 2)] A. Black Square
A. Black Square time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- Codeforces Round #247 (Div. 2) D. Random Task
D. Random Task time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- Codeforces Round #247 (Div. 2)
A.水题. 遍历字符串对所给的对应数字求和即可. B.简单题. 对5个编号全排列,然后计算每种情况的高兴度,取最大值. C.dp. 设dp[n][is]表示对于k-trees边和等于n时,如果is== ...
- Codeforces Round #247 (Div. 2) C题
赛后想了想,然后就过了.. 赛后....... 我真的很弱啊!想那么多干嘛? 明明知道这题的原型就是求求排列数,这不就是 (F[N]-B[N]+100000007)%100000007: F[N]是1 ...
- Codeforces Round #247 (Div. 2) C. k-Tree (dp)
题目链接 自己的dp, 不是很好,这道dp题是 完全自己做出来的,完全没看题解,还是有点进步,虽然这个dp题比较简单. 题意:一个k叉树, 每一个对应权值1-k, 问最后相加权值为n, 且最大值至少为 ...
- Codeforces Round #247 (Div. 2) C D
这题是一个背包问题 这样的 在一个k子树上 每个节点都有自己的k个孩子 然后 从原点走 走到 某个点的 和为 N 且每条的 长度不小于D 就暂停问这样的 路有多少条, 呵呵 想到了 这样做没有把他敲 ...
- 「专题训练」k-Tree(CodeForces Round #247 Div.2 C)
题意与分析(Codeforces-431C) 题意是这样的:给出K-Tree--一个无限增长的树,它的每个结点都恰有\(K\)个孩子,每个节点到它\(K\)个孩子的\(K\)条边的权重各为\(1,2, ...
随机推荐
- 算法系列:geometry
1.基本几何变换及变换矩阵 基本几何变换都是相对于坐标原点和坐标轴进行的几何变换,有平移.比例.旋转.反射和错切等. 1.1 平移变换 是指将p点沿直线路径从一个坐标位置移到另一个坐标位置的重定位过程 ...
- Introduction to replication 翻译
翻译自用,还有很多谬误之处,敬请甄别,转载请注明出处 Introduction to replication (replication介绍) Replication is one of the m ...
- PHPCMS_v9 wap不同列表采用不同模板的方法
.在phpcms\modules\wap\index.php中搜索 $template = ($TYPE[$typeid]['parentid']==0 && in_array($ty ...
- [Linux][Hadoop] 运行WordCount例子
紧接上篇,完成Hadoop的安装并跑起来之后,是该运行相关例子的时候了,而最简单最直接的例子就是HelloWorld式的WordCount例子. 参照博客进行运行:http://xiejiangl ...
- C++中的链接错误
1.有可能是类的函数实现的时候错误. 如:应该为MVT_PAR1* GpsTcpCallback::GetMUT_PAR1(unsigned char* data,int i), 却写成了MVT_PA ...
- Eclipse 快捷键 自动生成get/set注释(转)
Alt+Shit+S Generaet Getter and Setter 选中Generate method comments 文本编辑 复制行 Ctrl+Alt+向下键 编辑文本 快捷键:选中接 ...
- android:layout_weight属性详解 (转)
在android开发中LinearLayout很常用,LinearLayout的内控件的android:layout_weight在某些场景显得非常重要,比如我们需要按比例显示.android并没用提 ...
- ObCallback回调钩子检测
ObCallback回调钩子检测 2013-12-20 Nie.Meining Ring0 在 PatchGuard 的摧残下,通过 ObRegisterCallbacks 函数注册回调钩子已经成了 ...
- TCP, Scoket, HTTP
1.TCP连接 要想明白Socket连接,先要明白TCP连接.手机能够使用联网功能是因为手机底层实现了TCP/IP协议,可以使手机终端通过无线网络建立TCP连接.TCP协议可以对上层网络提供接口,使上 ...
- 自己yy的fulkson最大流算法
#include <iostream> #include <cstdio> #include <vector> using namespace std; ; //m ...