模拟即可

#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的更多相关文章

  1. Codeforces Round #247 (Div. 2) ABC

    Codeforces Round #247 (Div. 2) http://codeforces.com/contest/431  代码均已投放:https://github.com/illuz/Wa ...

  2. Codeforces Round #247 (Div. 2) B

    B. Shower Line time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  3. [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 ...

  4. 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 ...

  5. Codeforces Round #247 (Div. 2)

    A.水题. 遍历字符串对所给的对应数字求和即可. B.简单题. 对5个编号全排列,然后计算每种情况的高兴度,取最大值. C.dp. 设dp[n][is]表示对于k-trees边和等于n时,如果is== ...

  6. Codeforces Round #247 (Div. 2) C题

    赛后想了想,然后就过了.. 赛后....... 我真的很弱啊!想那么多干嘛? 明明知道这题的原型就是求求排列数,这不就是 (F[N]-B[N]+100000007)%100000007: F[N]是1 ...

  7. Codeforces Round #247 (Div. 2) C. k-Tree (dp)

    题目链接 自己的dp, 不是很好,这道dp题是 完全自己做出来的,完全没看题解,还是有点进步,虽然这个dp题比较简单. 题意:一个k叉树, 每一个对应权值1-k, 问最后相加权值为n, 且最大值至少为 ...

  8. Codeforces Round #247 (Div. 2) C D

    这题是一个背包问题 这样的 在一个k子树上 每个节点都有自己的k个孩子 然后 从原点走 走到 某个点的 和为 N 且每条的 长度不小于D 就暂停问这样的 路有多少条,  呵呵 想到了 这样做没有把他敲 ...

  9. 「专题训练」k-Tree(CodeForces Round #247 Div.2 C)

    题意与分析(Codeforces-431C) 题意是这样的:给出K-Tree--一个无限增长的树,它的每个结点都恰有\(K\)个孩子,每个节点到它\(K\)个孩子的\(K\)条边的权重各为\(1,2, ...

随机推荐

  1. Python中带参装饰器理解

  2. ASP.NET MVC中Controller返回值类型ActionResult

    1.返回ViewResult视图结果,将视图呈现给网页 public class TestController : Controller { //必须存在Controller\Test\Index.c ...

  3. HTML+CSS页面滚动效果处理

    HTML+CSS代码如下: <!doctype html> <html> <head> <meta charset="utf-8"> ...

  4. oracle JOB学习(一)---基础

    oracle job简介   下面文章来自网友(格式稍加整理)   主要的使用情景 定时在后台执行相关操作:如每天晚上0点将一张表的数据保存到另一张表中,2:定时备份数据库等   熟化说万事开头难,这 ...

  5. Oracle备份 还原命令

    1.备份命令 exp username/password file=d:/test/test.dmp; 2.还原命令 imp username/password full=y file=d:/test ...

  6. android 入门-关键词介绍

    1.@SuppressLint("HandlerLeak") 2.synchronized详解 http://www.cnblogs.com/GnagWang/archive/20 ...

  7. [Linux][Hadoop] 运行WordCount例子

    紧接上篇,完成Hadoop的安装并跑起来之后,是该运行相关例子的时候了,而最简单最直接的例子就是HelloWorld式的WordCount例子.   参照博客进行运行:http://xiejiangl ...

  8. WPF线程(Step1)——Dispatcher

    使用WPF开发时经常会遇上自己建立的线程需要更新界面UI内容,从而导致的跨线程问题. 异常内容: 异常类型:System.InvalidOperationException 异常描述: "S ...

  9. 第十五篇:在SOUI中消息通讯

    SOUI是一套基于Win32 SDK的窗口开发的一套DirectUI框架.在SOUI中除了有真窗口使用窗口消息通讯机制外,还有SOUI控件之间的通讯,及控件的事件处理等. 1.真窗口消息通讯 因此可以 ...

  10. HDU 5919 Sequence II 主席树

    Sequence II Problem Description   Mr. Frog has an integer sequence of length n, which can be denoted ...