CodeForces NO.549A Face Detection
来源:互联网 发布:ntoskrnl 占用80端口 编辑:程序博客网 时间:2024/05/17 07:43
问题描述:
找2 * 2 的照片,照片由f、a、c、e四个字符组成,可以重叠。详情见原题。
题目链接:CodeForces NO.549A
直接上代码:
#include<iostream>#include<cstdio>#include<cmath>#include<queue>#include<stack>#include<cstring>#include<algorithm>#define INF 0x3f3f3f3f#define MAX 100#define PI 3.1415926using namespace std;int dx[4] = {0, 0, 1, 1}, dy[4] = {0, 1, 0, 1};int main(){ int m, n; cin >> m >> n; char arr[MAX][MAX]; int f, a, c, e; for(int i = 0; i < m; i++) cin >> arr[i]; int ans = 0; for(int i = 0; i < m; i++) { for(int j = 0; j < n; j++) { f = a = c = e = 0; for(int k = 0; k < 4; k++) { int dx1 = i+dx[k], dy1 = j+dy[k]; if(arr[dx1][dy1] == 'f' && dx1 < m && dy1 < n) f = 1; else if(arr[dx1][dy1] == 'a'&& dx1 < m && dy1 < n) a = 1; else if(arr[dx1][dy1] == 'c'&& dx1 < m && dy1 < n) c = 1; else if(arr[dx1][dy1] == 'e'&& dx1 < m && dy1 < n) e = 1; } if(a + f + c + e == 4) ans++; } } cout << ans << endl; return 0;}
1 0
- CodeForces NO.549A Face Detection
- codeforces 549A Face Detection
- coderforce 549A Face Detection
- A. Face Detection
- Looksery Cup 2015 A. Face Detection
- Looksery Cup 2015 A. Face Detection
- 【数据集】A Face Detection Benchmark
- Performing Face Detection on a video
- face-detection
- Face Detection
- Face Detection
- Face Detection
- Face Detection
- Face Detection
- 论文《A Convolutional Neural Network Cascade for Face Detection》笔记
- [文献阅读]A Convolutional Neural Network Cascade for Face Detection
- 【论文笔记】A Convolutional Neural Network Cascade for Face Detection
- 论文《A Convolutional Neural Network Cascade for Face Detection》笔记
- JZOJ 1460.无题noname
- ACM心理过程
- (转载)Android 最火的快速开发框架XUtils
- 使用ContentProvider读取系统联系人信息
- 进制转换[PAT]
- CodeForces NO.549A Face Detection
- MySQL主从复制原理
- CSAPP 3e Attack lab
- android 打造炫酷导航栏(仿UC头条)
- 归并排序
- 常浏览的博客和网站
- 最值得你所关注的10个C语言开源项目
- linux常用命令2(转载)
- Java关键字final、static使用总结