ural 1869
简单题 ~~
#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的更多相关文章
- 1869: Mathematics and Geometry
这是郑州轻工业学校的一次校赛的校内选拔赛,看名字是计算几何 的题 题目地址: http://acm.zzuli.edu.cn/zzuliacm/problem.php?id=1869 Descript ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- 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 ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
随机推荐
- 20140215-搭建phonegap开发环境
1.安装jdk,配置环境变量 a)设置 JAVA_HOME =E:\SetUpFiles\win8.1\Java\jdk1.6.0_45 b)设置PATH=E:\SetUpFiles\win8.1\J ...
- 《JavaScript高级程序设计》心得笔记-----第三篇章
第十章 1. DOM1级定义了一个Node接口,以Node类型实现(除IE以外),为了确保跨浏览器兼容,最好用nodeType属性与数字数值进行比较(someNode. nodeType==1) ...
- Android Audio Play Out Channel
1: 7嘴8舌 扬声器, 耳机, 和听筒 就是通过: audiomanager.setmode(AudioManager.MODE_IN_COMMUNICATION)audiomanager.setS ...
- AngularJS(16)-路由
AngularJS 路由 本章节我们将为大家介绍 AngularJS 路由. AngularJS 路由允许我们通过不同的 URL 访问不同的内容. 通过 AngularJS 可以实现多视图的单页Web ...
- php文本操作方法集合比较
fgets和fputs.fread和fwrite.fscanf和fprintf 字符串读写函数fgets和fputs 一.读字符串函数fgets函数的功能是从指定的文件中读一个字符串到字符数组中,函数 ...
- 大陆Azure 改版
好吧主页的又改版了这下终于容易区分大陆与国际版的区别了.2014年12月12日起改版. 主页再次沦落为找不到东西的后果,其实很少进入这个主页,一般也直接使用http://manage.windowsa ...
- oracle中的记录类型
单词RECORD有“记录”的意思,因此RECORD也称为“记录类型”,使用该类型的变量可以存储由多个列值组成的一行数据. 在声明记录类型变量之前,首先需要定义记录类型,然后才可以声明记录类型的变量. ...
- parameter和argument的区别
根据网上一些资料,对parameter和argument的区别,做如下的简单说明.1. parameter是指函数定义中参数,而argument指的是函数调用时的实际参数.2. 简略描述为:param ...
- Setting composer minimum stability for your application
Do you have a confusion of how do you determine the stability when using composer dependency manager ...
- Entity Framework学习笔记(六)----使用Lambda查询Entity Framework(1)
请注明转载地址:http://www.cnblogs.com/arhat 在前几章中,老魏一直使用Linq来查询Entity Framework.但是老魏感觉,如果使用Linq的话,那么Linq的返回 ...