当前位置:网站首页>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;
}
边栏推荐
- Your wechat nickname may be betraying you
- 学习记录:STM32F103 时钟系统概述工作原理
- ucore lab7
- C 基本语法
- TCP的三次握手与四次挥手
- Cost accounting [19]
- 学习记录:USART—串口通讯
- What is "test paper test" in software testing requirements analysis
- How to change XML attribute - how to change XML attribute
- Word macro operation: convert the automatic number in the document into editable text type
猜你喜欢
Future trend and planning of software testing industry
ucore Lab 1 系统软件启动过程
C语言数组的概念
LeetCode#62. Different paths
程序员的你,有哪些炫技的代码写法?
Learning record: use stm32f1 watchdog
学习记录:USART—串口通讯
Optimization method of path problem before dynamic planning
Visual analysis of data related to crawling cat's eye essays "sadness flows upstream into a river" | the most moving film of Guo Jingming's five years
Eslint--- error: newline required at end of file but not found (EOL last) solution
随机推荐
MATLAB综合练习:信号与系统中的应用
Future trend and planning of software testing industry
ArrayList set
学习记录:TIM—电容按键检测
TCP的三次握手与四次挥手
Cost accounting [20]
STM32學習記錄:輸入捕獲應用
Market trend report, technological innovation and market forecast of pneumonia drugs obtained by Chinese hospitals
China's salt water membrane market trend report, technological innovation and market forecast
ucore Lab 1 系统软件启动过程
Market trend report, technical innovation and market forecast of Chinese hospital respiratory humidification equipment
学习记录:串口通信和遇到的错误解决方法
Want to change jobs? Do you know the seven skills you need to master in the interview software test
China's earthwork tire market trend report, technical dynamic innovation and market forecast
How to change XML attribute - how to change XML attribute
ucorelab4
Cost accounting [19]
Cost accounting [14]
51 lines of code, self-made TX to MySQL software!
Visual analysis of data related to crawling cat's eye essays "sadness flows upstream into a river" | the most moving film of Guo Jingming's five years