//也是简单题,因为n太小,故暴力之!

 #include<stdio.h>
#include<math.h>
#include<string.h>
#define max 45 char map[max][max]; int dis(int x1,int y1,int x2,int y2){
return fabs(x1-x2*1.0)+fabs(y1-y2*1.0);
} int main(){
int n,m;
while(~scanf("%d%d",&n,&m)){
if(n==&&m==){
break;
}
getchar();
for(int i=;i<n;i++){
scanf("%s",map[i]);
// puts(map[i]);
}
int ans=,x1,y1,x2,y2;
for(int i=;i<n;i++){
for(int j=;j<m;j++){
if(map[i][j]!='H'){
continue;
}
for(int k=;k<n;k++){
for(int h=;h<m;h++){
if(map[k][h]!='C'){
continue;
}
int res=dis(i,j,k,h);
if(ans>res){
ans=res;
x1=i; y1=j;
x2=k; y2=h;
}
}
}
}
}
printf("%d %d %d %d\n",x1,y1,x2,y2);
}
}

HDU 4584的更多相关文章

  1. hdu 4584 水题爽一发 *

    #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #i ...

  2. HDU 4584 splay

    Shaolin Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Sub ...

  3. HDU 4584 Building bridges (水题)

    Building bridges Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) ...

  4. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  5. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  6. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  7. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  8. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  9. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

随机推荐

  1. 对this的理解与总结

    this既不指向函数自身,也不指向函数的词法作用域!它指向谁完全取决于它在哪里被调用,被谁调用! 绑定规则 总体来说,this的绑定规则有: 默认绑定(严格模式/非严格模式) 隐式绑定 显式绑定 ne ...

  2. opencv编译:The CXX compiler identification is unknown The C compiler identification is unknown

    opencv编译:The CXX compiler identification is unknown The C compiler identification is unknown 解决方法: F ...

  3. 解决Spring Boot Configuration Annotation Processor not found in classpath

    问题截图: 解决方式: 在pom.xml文件中添加这些依赖 <dependency> <groupId>org.springframework.boot</groupId ...

  4. leetcode146周赛-5132-颜色最短的交替路径

    ---恢复内容开始--- 题目描述: class Solution: def shortestAlternatingPaths(self, n: int, red_edges, blue_edges) ...

  5. logger----->模块级别的函数

    #_author:star#date:2019/11/6#logger----->模块级别的函数#文件与屏幕同时显示日志信息import logginglogger=logging.getLog ...

  6. 字符串哈希——1056E

    典型的字符串哈希题 字符串hash[i]:子串s[1-i]代表的值 要截取串s[l-r]  求hash[r]-hash[l-1]*F[len]即可 #include<bits/stdc++.h& ...

  7. 自己整理的一个访问SQLite3数据库的C++类

    原文地址:自己整理的一个访问SQLite3数据库的C++类作者:vigra 近日,对SQLite3的使用进行了研究.真不愧是优秀的嵌入数据库,API接口也极其简捷.基本上只要使用以下几个接口就能完成数 ...

  8. Python学习day36-并发编程(2)

    figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { position: relative; } img { max- ...

  9. 04-3-object类型

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. mybatis-环境配置-基本案例-和hibernate区别

    Mybatis第一天 1.  Mybatis介绍 MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了goo ...