简单题 ~~

#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. (转)Linux概念架构的理解

    英文原文:Conceptual Architecture of the Linux Kernel 摘要 Linux kernel成功的两个原因:(1)架构设计支持大量的志愿开发者加入到开发过程中:(2 ...

  2. Sublime Text 2入门指南

    Sublime Text 2入门指南   一天在iteye上看到范凯介绍一个开发工具(TextMate ),看下面的评论时看到Sublime Text 2.其实我一直喜欢editplus.百度了一番才 ...

  3. windows通过thrift访问hdfs

    thirift是一个支持跨种语言的远程调用框架,通过thrift远程调用框架,结合hadoop1.x中的thriftfs,编写了一个针对hadoop2.x的thriftfs,供外部程序调用. 1.准备 ...

  4. MATLAB学习(3)

    matlab读取图像并转化为灰度图像 image = imread('C:\Users\Administrator\Desktop\图像降噪\src\original image\100.png'); ...

  5. php 去除数组中重复元素

    去除数组中重复元素, 找了下可以一下两个函数 php array_flip()与array_uniqure() $arr = array(…………) ;// 假设有数组包含一万个元素,里面有重复的元素 ...

  6. Abstract_Factory

    #include <iostream> using namespace std; #define DESTORY_POINTER(ptr) if (ptr) { delete ptr; p ...

  7. IOS_问题: Xcode8 安装KSImageName插件, 编代码就崩了

    Xcode 8之后, KSImageName插件就不能用了,如果安装了,就会导致一写英文代码Xcode 就崩了. 解决方法: 把这个插件删除,重启了一下xcode就可以了, 如果重启没用, 可以尝试下 ...

  8. Vim复制粘贴

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

  9. 如果在配置中将“system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled”设置为 true,则需要终结点指定相对地址。如果在终结点上指定相对侦听 URI,则该地址可以是绝对地址。若要解决此问题,请为终结点“http://localhost/Service1.svc”指定相对 URI。

    问题: 如果在配置中将"system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled"设置为 ...

  10. [转]null和""以及==与equals的区别

    String str1 = null; str引用为空 String str2 = ""; str引用为空串 直接点就是null没有分配内存空间,而""分配了内 ...