哈哈,好爽好爽,刷水题报复社会啦。。。

哥这次省赛一定要拿一等奖,让你小看我,让你小看我。。。。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int inf=(<<);
int score[][]; int dir[][]={
{,},
{,-},
{,},
{-,}
}; bool ok(int i,int j,int n,int m){
if(i>=&&i<=n&&j>=&&j<=m) return true;
return false;
} int main(){
int n,m;
while(scanf("%d%d",&n,&m)&&n||m){
for(int i=;i<=n;i++){
for(int j=;j<=m;j++)
scanf("%d",&score[i][j]);
}
int sum;
int ansi,ansj,ans=-inf,ti,tj;
for(int i=;i<=n;i++){
for(int j=;j<=m;j++){
sum=;
for(int k=;k<;k++){
ti=i+dir[k][];
tj=j+dir[k][];
if(ok(ti,tj,n,m)){
if(score[ti][tj]*score[i][j]>){
sum-=abs(score[ti][tj]);
}
else sum+=abs(score[ti][tj]);
}
}
if(sum>ans){
ans=sum;
ansi=i; ansj=j;
}
}
}
printf("%d %d %d\n",ansi,ansj,ans);
} return ;
}

HDU 4500的更多相关文章

  1. HDU 4500 小Q系列故事——屌丝的逆袭(简单题)

    http://acm.hdu.edu.cn/showproblem.php?pid=4500 AC代码: #include<math.h> #include<stdio.h> ...

  2. HDU 4500 小Q系列故事——屌丝的逆袭

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4500 解题报告:简单题,数据范围不大,直接暴力每个点,然后再比较出得分最大的点的位置和分数. #inc ...

  3. HDU 5919 Sequence II(主席树+逆序思想)

    Sequence II Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) To ...

  4. HDU 5925 Coconuts 【离散化+BFS】 (2016CCPC东北地区大学生程序设计竞赛)

    Coconuts Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Su ...

  5. HDU 5927 Auxiliary Set 【DFS+树】(2016CCPC东北地区大学生程序设计竞赛)

    Auxiliary Set Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tot ...

  6. hdu 5919 主席树(区间不同数的个数 + 区间第k大)

    Sequence II Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Tot ...

  7. HDU 5925 Coconuts 离散化

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5925 Coconuts Time Limit: 9000/4500 MS (Java/Others) ...

  8. HDU 1445 Ride to School

    http://acm.hdu.edu.cn/showproblem.php?pid=1445 Problem Description Many graduate students of Peking ...

  9. HDU 5919 Sequence ll

    Time limit 4500 ms Memory limit 131072 kB OS Windows Source 2016中国大学生程序设计竞赛(长春)-重现赛 中文题意 一个长度为n的序列,里 ...

随机推荐

  1. 【WIP】Rails devise导入与使用方法

    创建: 2017/09/07 更新: 2017/10/14 标题加上[WIP]     源代码: https://github.com/plataformatec/devise  命令行内容总结  安 ...

  2. B - String Task

    Problem description Petya started to attend programming lessons. On the first lesson his task was to ...

  3. HBase、Hive、MapReduce、Hadoop、Spark 开发环境搭建后的一些步骤(export导出jar包方式 或 Ant 方式)

    步骤一 若是,不会HBase开发环境搭建的博文们,见我下面的这篇博客. HBase 开发环境搭建(Eclipse\MyEclipse + Maven) 步骤一里的,需要补充的.如下: 在项目名,右键, ...

  4. 树莓派-解决apt-get upgrade速度慢的方法[更换阿里云源]

    执行 apt-get upgrade 遇到速度慢的原因: 使用国外软件源 解决方法也很简单,将源换为国内环境即可,我选择阿里云 步骤 1.备份为 sources.list sudo cp /etc/a ...

  5. Android 新浪微博开放平台应用 android签名怎么获得

    方法一: 通过命令行,直接生成MD5值 keytool -list -v -keystore keystorefile -storepass 其中keytool为jdk自带工具:keystorefil ...

  6. Leetcode0100--Same Tree 相同树

    [转载请注明]http://www.cnblogs.com/igoslly/p/8707664.html 来看一下题目: Given two binary trees, write a functio ...

  7. hadoop job history server

    默认情况下是没有启动的,需要配置完后手工启动服务. 1. 修改mapred-site.xml,添加如下内容(cluster mode, RM) <property>     <nam ...

  8. Eclipse之调试代码和返回

    编写代码时,经常会遇到各种莫名其妙的问题,为了检测程序是哪里出现问题,我们通过断点调试来判断哪一步出错 一.断点 在需要断点的地方,在左侧双击鼠标设置断点,可设置多个 去掉断点:在断点上双击一下,没有 ...

  9. 基于神经网络的混合计算(DNC)-Hybrid computing using a NN with dynamic external memory

    前言: DNC可以称为NTM的进一步发展,希望先看看这篇译文,关于NTM的译文:人工机器-NTM-Neutral Turing Machine 基于神经网络的混合计算 Hybrid computing ...

  10. cmd 运行 svn 亲测!!!

    如果之前安装了svn客户端,但是一直提示svn停止工作的话就可以用cmd去操作svn更新和提交了:或者可以直接用别的代码IDE(包含svn插件的)去进行svn的操作. 接下来我说说windows如何用 ...