HDU 4500
哈哈,好爽好爽,刷水题报复社会啦。。。
哥这次省赛一定要拿一等奖,让你小看我,让你小看我。。。。
#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的更多相关文章
- HDU 4500 小Q系列故事——屌丝的逆袭(简单题)
http://acm.hdu.edu.cn/showproblem.php?pid=4500 AC代码: #include<math.h> #include<stdio.h> ...
- HDU 4500 小Q系列故事——屌丝的逆袭
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4500 解题报告:简单题,数据范围不大,直接暴力每个点,然后再比较出得分最大的点的位置和分数. #inc ...
- HDU 5919 Sequence II(主席树+逆序思想)
Sequence II Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) To ...
- HDU 5925 Coconuts 【离散化+BFS】 (2016CCPC东北地区大学生程序设计竞赛)
Coconuts Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Su ...
- HDU 5927 Auxiliary Set 【DFS+树】(2016CCPC东北地区大学生程序设计竞赛)
Auxiliary Set Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Tot ...
- hdu 5919 主席树(区间不同数的个数 + 区间第k大)
Sequence II Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Tot ...
- HDU 5925 Coconuts 离散化
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5925 Coconuts Time Limit: 9000/4500 MS (Java/Others) ...
- HDU 1445 Ride to School
http://acm.hdu.edu.cn/showproblem.php?pid=1445 Problem Description Many graduate students of Peking ...
- HDU 5919 Sequence ll
Time limit 4500 ms Memory limit 131072 kB OS Windows Source 2016中国大学生程序设计竞赛(长春)-重现赛 中文题意 一个长度为n的序列,里 ...
随机推荐
- codeforces round #420 div2
A:暴力枚举 模拟 #include<bits/stdc++.h> using namespace std; ; int n; int a[N][N]; int main() { scan ...
- curl强制下载文件
<?phpfunction download_remote_file_with_curl($file_url, $save_to) { $ch = curl_init(); curl_setop ...
- golang struct里面的字段,或者slice排序
accounts := []users.Account{}Admin.DB.Preload("CurrencyObj").Where("member_id = ?&quo ...
- Spark2.0.2+Zeppelin0.6.2 环境搭建 初探
0.抱怨与其他(此部分与标题没有太多联系): 首先一点想说的是版本问题,为什么标题我会写清楚版本号呢!原因就是版本不对真的很会坑人. 就在写这篇博客的同一天,我还写了另一篇,是 Hadoop2.7.3 ...
- 2015 多校赛 第三场 1002 (hdu 5317)
Description Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more i ...
- Shiro图解
- windows phone数据网络开发
LINQ LINQ的全称是Language INtegrated Query,即语言集成查询.LINQ是一种查询语言,不仅可以对数字库进行查询,还可以对.net的数据集.数组.Xml文档等对象进行查询 ...
- 基于CXF搭建webService
1.导入相关jar包,具体哪些包我记不太清了 2.在applicationContext中加入相关配置信息,如下所示: <beans xmlns="http://www.springf ...
- android 国际化 横屏(land) 竖屏(port)margin外边距和padding内边距
android 国际化 横屏(land) 竖屏(port) 边距又分为内边距和外边距,即margin和padding.
- HEK_费用报表审核无审核权限,有些字段无法编辑的问题处理
Q:HEK_费用报表审核无审核权限,有些字段无法编辑的问题处理 A:设置AP员工->给AP员工分配审批权限->绑定员工和ERP账号 1.将审核人设置为AP员工 2.分配给员工审批权限 3. ...