toj3857. Jiong
来源:互联网 发布:iphone实用软件排行 编辑:程序博客网 时间:2024/06/05 23:42
其实题目略水,但看起来有点怕
然后当\不能被系统识别时,可以在其前面再加一个\
思路便是先把jiong用数组存起来,然后进行枚举
#include <map>#include <set>#include <stack>#include <queue>#include <cmath>#include <ctime>#include <vector>#include <cstdio>#include <cctype>#include <cstring>#include <cstdlib>#include <iostream>#include <algorithm>using namespace std;#define INF 0x3f3f3f3f#define inf -0x3f3f3f3f#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define mem0(a) memset(a,0,sizeof(a))#define mem1(a) memset(a,-1,sizeof(a))#define mem(a, b) memset(a, b, sizeof(a))typedef long long ll;const int N=5;const int maxn=55;const int M=10+1;char jiong[N][M]={ "+--------+", "| / \\ |", "|/ +--+ \\|", "| | | |", "+--+--+--+"};char mp[maxn][maxn];int solve(int x,int y){ for(int i=x;i<x+5;i++) for(int j=y;j<y+10;j++){ if(mp[i][j]!=jiong[i-x][j-y]) return 0; } return 1;}int main(){ int n,m; while(scanf("%d%d",&n,&m)==2){ for(int i=0;i<n;i++){ getchar(); for(int j=0;j<m;j++) scanf("%c",&mp[i][j]); }/* for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cout<<mp[i][j]; } cout<<endl; } */ int cnt=0; for(int i=0;i<=n-N;i++) for(int j=0;j<=m-10;j++){ if(solve(i,j)) cnt++; } printf("%d\n",cnt); } return 0;}
0 0
- toj3857. Jiong
- Big Jiong
- 很jiong的一天又过去了
- MyEclipse下复制的web项目
- 深入理解JDBC的超时设置
- 手机的1G,2G,3G和4G区别识记
- C#范型学习1
- Android-Universal-Image-Loader三大组件DisplayImageOptions、ImageLoader、ImageLoaderConfiguration详解
- toj3857. Jiong
- VT-x is disabled in the BIOS. (VERR_VMX_MSR_VMXON_DISABLED).
- maven private registry
- Windows平台安装Beautiful Soup
- 子类用反射可以访问父类中的私有成员变量及方法
- Yii2学习笔记(十一):模型中attributeLabels()函数的作用
- 解决bootstrap switch 开关OFF被断开导致排版混乱的问题
- 【noip2014提高组】飞扬的小鸟
- 使用Autolayout实现UITableView的Cell动态布局和高度动态改变