当前位置:网站首页>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;
}
边栏推荐
- Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
- ucore lab 6
- ucore lab7
- Indonesian medical sensor Industry Research Report - market status analysis and development prospect forecast
- Optimization method of path problem before dynamic planning
- LeetCode#118. Yanghui triangle
- 毕业才知道IT专业大学生毕业前必做的1010件事
- Cost accounting [20]
- ucore lab 6
- 基于485总线的评分系统
猜你喜欢

动态规划前路径问题优化方式

LeetCode#19. Delete the penultimate node of the linked list
What is "test paper test" in software testing requirements analysis

LeetCode#62. Different paths

Learning record: use STM32 external input interrupt

Learning record: USART serial communication

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

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

Intensive learning notes: Sutton book Chapter III exercise explanation (ex17~ex29)
Future trend and planning of software testing industry
随机推荐
csapp shell lab
学习记录:使用STM32F1看门狗
ArrayList set
Accounting regulations and professional ethics [5]
Market trend report, technical innovation and market forecast of geosynthetic clay liner in China
ucore lab7
Leetcode notes - dynamic planning -day7
Research Report on pharmaceutical R & D outsourcing service industry - market status analysis and development prospect forecast
Do you know the advantages and disadvantages of several open source automated testing frameworks?
MATLAB综合练习:信号与系统中的应用
Cost accounting [18]
Research Report of pharmaceutical solvent industry - market status analysis and development prospect prediction
C4D quick start tutorial - creating models
ucorelab4
Word macro operation: convert the automatic number in the document into editable text type
Stm32 dossiers d'apprentissage: saisie des applications
ucorelab3
动态规划前路径问题
Cost accounting [22]
STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)