当前位置:网站首页>Determine the Photo Position
Determine the Photo Position
2022-07-06 09:25:00 【是小张张呀 zsy】
Determine the Photo Position
链接:https://ac.nowcoder.com/acm/contest/11166/D
来源:牛客网

输入:
5 3
00000
01110
01110
01110
00000
222
输出
6
输入
3 2
101
010
101
22
输出
0
输入
3 1
101
010
101
2
输出
4
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <math.h>
#include <string.h>
using namespace std;
char c[2001][2001];
int main()
{
int n,m;
cin>>n>>m;
int ans=0;
int sum=0;
for(int i=1;i<=n;i++)
{
sum=0;
for(int j=1;j<=n;j++)
{
cin>>c[i][j];
if(c[i][j]=='0')
sum++;
else
sum=0;
if(sum>=m)
ans++;
}
// cout<<ans;
}
cin>>m;
cout<<ans<<endl;
return 0;
}
边栏推荐
- 学习记录:TIM—基本定时器
- JS --- detailed explanation of JS DOM (IV)
- 毕业才知道IT专业大学生毕业前必做的1010件事
- CSAPP shell lab experiment report
- JS --- JS function and scope (II)
- Jupyter installation and use tutorial
- 力扣刷题记录--完全背包问题(一)
- LeetCode#19. Delete the penultimate node of the linked list
- Research Report on medical anesthesia machine industry - market status analysis and development prospect prediction
- Medical colposcope Industry Research Report - market status analysis and development prospect forecast
猜你喜欢

数据在内存中的存储&载入内存,让程序运行起来

Learning record: how to perform PWM output

The wechat red envelope cover designed by the object is free! 16888

ucore Lab 1 系统软件启动过程

Servlet

Interface test interview questions and reference answers, easy to grasp the interviewer

学习记录:TIM—电容按键检测

ucorelab4

Crawling cat's eye movie review, data visualization analysis source code operation instructions

FSM和i2c实验报告
随机推荐
Learning records: serial communication and solutions to errors encountered
JS --- JS function and scope (II)
UCORE Lab 1 system software startup process
Lab 8 文件系统
ucore lab5
学习记录:理解 SysTick系统定时器,编写延时函数
The most detailed postman interface test tutorial in the whole network. An article meets your needs
ucore lab 6
0-1背包问题(一)
Accounting regulations and professional ethics [5]
Interface test interview questions and reference answers, easy to grasp the interviewer
Cost accounting [14]
China chart recorder market trend report, technology dynamic innovation and market forecast
通俗地理解什么是编程语言
Market trend report, technological innovation and market forecast of pneumonia drugs obtained by Chinese hospitals
The wechat red envelope cover designed by the object is free! 16888
Cost accounting [21]
0-1 knapsack problem (I)
Crawler series (9): item+pipeline data storage
China earth moving machinery market trend report, technical dynamic innovation and market forecast