简单题 ~~

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std; int a[110][110], _max;
void cood(int n)
{
int sum = 0;
for(int i = 1; i <= n; i ++)
{
for(int j = 1; j < i; j ++)
sum -= a[j][i];
for(int j = i+1; j <= n; j ++)
{
sum += a[i][j];
}
_max = max(_max, sum);
}
}
void res(int n)
{
for(int i = 1; i <= n; i ++)
for(int j = i+1; j <= n; j ++)
{
int tem = a[i][j];
a[i][j] = a[j][i];
a[j][i] = tem;
}
}
int main()
{
int n;
scanf("%d", &n);
_max = 0;
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n; j ++)
scanf("%d",&a[i][j]);
cood(n);
res(n);
cood(n);
printf("%d\n", _max%36 == 0 ? _max/36:_max/36+1);
return 0;
}

ural 1869的更多相关文章

  1. 1869: Mathematics and Geometry

    这是郑州轻工业学校的一次校赛的校内选拔赛,看名字是计算几何 的题 题目地址: http://acm.zzuli.edu.cn/zzuliacm/problem.php?id=1869 Descript ...

  2. 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome

    题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...

  3. ural 2071. Juice Cocktails

    2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...

  4. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

  5. ural 2070. Interesting Numbers

    2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...

  6. ural 2069. Hard Rock

    2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...

  7. ural 2068. Game of Nuts

    2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...

  8. ural 2067. Friends and Berries

    2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...

  9. ural 2066. Simple Expression

    2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...

随机推荐

  1. 依赖映射 Dependent Mapping

    让一个类为其子类(泛意上的)执行DB映射 一些对象肯定会出现在另一对象的上下文中. 此时,使用另一对象的Mapper来执行第一个对象的映射,来简化映射过程. 运行机制 在DB持久化时,依赖者类依赖于所 ...

  2. Ajax 技术二

    一.Ajax与XML案例 例:使用Ajax+XML读取数据表中的分类信息并放入下拉选框中 demo01.php 运行结果: 二.Ajax中的JSON 在Javascript中,可以通过两种方式(XML ...

  3. [Guava源码分析] Preconditions 前置条件

    我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3874170.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...

  4. Linux下OpenCV的环境搭建

    OpenCV is the most popular and advanced code library for Computer Vision related applications today, ...

  5. Makefile中=、:=、+=、?=的区别

    =,就是基本的赋值 :=,覆盖原来的值 +=,添加新值 ?=,如果没有赋值则赋值

  6. 推荐一些C#相关的网站、资源和书籍

    一.网站 1.http://msdn.microsoft.com/zh-CN/ 微软的官方网站,C#程序员必去的地方.那里有API开发文档,还有各种代码.资源下载. 2.http://social.m ...

  7. HBase多条件筛选查询方案

    最近的项目需要使用Hbase做实时查询,由于Hbase只支持一级索引,也就是使用rowkey作为索引查询,所以对于多条件筛选查询的支持不够,在不建立二级索引的情况下,只能使用Hbase API中提供的 ...

  8. 从0零开始学slatstack-(0)在centos 6.5 安装 python2.7 salt

    由于服务器环境问题,我的一个小玩意失败了,于是下决心学习下saltstack来弄个好使的自动化配置管理工具.之所以不考虑puppet等,主要原因是我不熟ruby,深入学习困难.再其次,为什么考虑2.7 ...

  9. Vim复制粘贴

    用了快一年Vim了,今天想要将vim里的一句话复制到浏览器里,结果捣鼓了半天.汗! 解决方案: 在vim中按“V”进入可视模式,选中要复制的文字 接下来要按3个键“+y(引号.加号.字母y),这样要复 ...

  10. php后台如何避免用户直接进入方法实例

    这篇文章介绍了php后台如何避免用户直接进入方法实例,有需要的朋友可以参考一下 1)创建BaseController控制器继承Controller(后台的一切操作要继承BaseController): ...