hihocoder #1099 枚举
来源:互联网 发布:农村淘宝 土豪村 编辑:程序博客网 时间:2024/06/03 20:56
本来解题报告已经很详细了,然而还是留了一个坑。
用相对位置标记最多二十个星星的位置,但是如果这样
。。。。。
。。。。。
。。。#。
。。。#。
只有右下角四个位置有用,也就是说其他的。。有没有都是一样的,直接把星图简化成
#。
#。
#include<iostream> #include<map>#include<string.h> #include<algorithm> #include<fstream>#include<cmath> #include<vector>#include<queue>#include<map>#include<math.h>using namespace std; #define lch(i) ((i)<<1) #define rch(i) ((i)<<1|1) #define sqr(i) ((i)*(i)) #define pii pair<int,int> #define mp make_pair #define FOR(i,b,e) for(int i=b;i<=e;i++) #define FORE(i,b,e) for(int i=b;i>=e;i--) #define ms(a) memset(a,0,sizeof(a)) const int maxnum =21252;const int mod = 10007;int n,m;struct cor{int x,y;}star[21][21];char sky[1001][1001];int main() { #ifdef _DEBUG_fstream fin("G:/1.txt");#else#define fin cin#endiffin>>n;ms(star);char line[101];FOR(i,1,n){int a,b;fin>>a>>b;int ma=a,mb=b;FOR(j,0,a-1){fin>>line;FOR(k,0,b-1){if(line[k]=='#'){star[i][++star[i][0].x].x=j;star[i][star[i][0].x].y=k;ma=min(ma,j);mb=min(mb,k);}}}FOR(j,1,star[i][0].x){star[i][j].x-=ma;star[i][j].y-=mb;}}int a,b;int flag=0;fin>>a>>b;FOR(i,0,a-1)fin>>sky[i];FOR(nth,1,n){flag=0;FOR(i,0,a-1){FOR(j,0,b-1){int match=1;FOR(k,1,star[nth][0].x){int x1=i+star[nth][k].x,y1=j+star[nth][k].y;if(sky[x1][y1]!='#'||x1>a-1||y1>b-1){match=0;break;}}if(match){flag=1;break;}}if(flag)break;}if(flag)printf("Yes\n");elseprintf("No\n");} return 0; }
0 0
- hihocoder #1099 枚举
- hihocoder #1249 枚举
- hihocoder #1255 枚举
- hihoCoder 1223 不等式 (枚举)
- hihocoder 1580 枚举+dp+RMQ
- hihoCoder挑战赛14 题目1 : 不等式 枚举?
- hihocoder 1264 神奇字符串 (枚举+模拟)
- hihocoder 1039 字符消除 (枚举+模拟)
- hihocoder #1227 : The Cats' Feeding Spots(枚举)
- hihoCoder 字符消除 (字符串处理)(枚举)
- hihoCoder 1051 : 补提交卡 枚举
- hihocoder 1326 dp OR 思维+枚举
- hihocoder 1580 Matrix [dp+枚举+rmq]
- hihoCoder - 1051 - 补提交卡 (枚举,贪心!!)
- hihoCoder - 1094 - Lost in the City (暴力枚举!!)
- HihoCoder 挑战赛12 C #1179 : 永恒游戏(枚举)
- hihoCoder - 1051 - 补提交卡(贪心、枚举)
- HihoCoder 1271舰队游戏(二进制枚举、贪心)
- NFA-DFA(c++实现代码c#实现画图)
- 从头认识java-7.6 适配设计模式究竟适配类?还是适配接口?
- week10---11月11日 JS基础(四)
- OpenGL_Qt学习笔记之_03(平面图形的着色和旋转)
- audio和EMBED配合同时兼容IE8和safiri
- hihocoder #1099 枚举
- oracle参数open_cursors和session_cached_cursor详解!
- Java读取xml文件的四种方法
- ASP.NET多文件上传实例
- Qt从零开始制作串口调试助手-(第四章、新建“串口配置界面”和“关于界面”)-Creator_Ly
- 泛型限定
- 二叉树0607
- hdu 4689 Derangement(dp)
- OpenGL_Qt学习笔记之_04(3D图形的绘制和旋转)