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

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

#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. LA4788

    贪心 这个贪心不太懂啊 dfs返回子树需要的最小值,然后按需要减消耗排序,然后贪心选取即可. #include<bits/stdc++.h> using namespace std; ty ...

  2. 【BZOJ4555】【TJOI2016】【HEOI2016】求和

    题目 传送门 解法 我们可以用容斥来求第二类斯特林数 我们知道, 第二类斯特林数\(S(n, k)\)是\(n\)个元素放进\(k\)个无标号的盒子里, 不可以含有空的. 于是我们可以考虑可以含有空的 ...

  3. Springboot+hibernate简单的增删改查

    1.创建好项目之后在配置端口号(也可以不用配置,默认端口8080) #server server.port= server.tomcat.uri-encoding=utf- 2.配置mysql #My ...

  4. 离线安装 Rancher2.2.4 HA 集群

    一.先决条件(所有主机执行) 1.1 基础设置 1.安装基础软件 yum install -y vim net-tools wget lrzsz 2.防火墙 sed -i 's/SELINUX=enf ...

  5. 从flink-example分析flink组件(1)WordCount batch实战及源码分析

    上一章<windows下flink示例程序的执行> 简单介绍了一下flink在windows下如何通过flink-webui运行已经打包完成的示例程序(jar),那么我们为什么要使用fli ...

  6. Blender插件初始化范例

    目标 [x] 总结Blender插件初始化范例 总结 插件模板 Blender内部插件实现方式模板功能总结如下: 定义了子模块重加载方式 定义了批量加载子模块的方式 插件注册函数 插件注销函数 模块总 ...

  7. R - Games

    Problem description Manao works on a sports TV. He's spent much time watching the football games of ...

  8. HttpWebRequest 知识点

    string Url = System.Configuration.ConfigurationManager.AppSettings["CallPaperInvoiceURL"]; ...

  9. 如何安全使用dispatch_sync

    概述 iOS开发者在与线程打交道的方式中,使用最多的应该就是GCD框架了,没有之一.GCD将繁琐的线程抽象为了一个个队列,让开发者极易理解和使用.但其实队列的底层,依然是利用线程实现的,同样会有死锁的 ...

  10. sql 导入excel 遇到问题

    ALTER TABLE tab1 add id int identity primary key (注意:必须加identity,否则添加会失败) //导入excel时候 先把主键去掉 变为可为空,之 ...