777C Alyona and Spreadsheet
来源:互联网 发布:英雄联盟mac有国服? 编辑:程序博客网 时间:2024/05/16 01:33
题目链接:点击打开链接
#include<stdio.h>
#include<string.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int>a[100010],dp[100010];
int len[100010];
int main()
{
int n,m,i,j,k,l,r;
while(~scanf("%d%d",&n,&m))
{
for(i=1;i<=n;i++)
{
a[i].resize(m+1);
for(j=1;j<=m;j++)
scanf("%d",&a[i][j]);
}
memset(len,0,sizeof(len));
for(i=1;i<=n;i++)
{
dp[i].resize(m+1);
if(i==1)
for(j=1;j<=m;j++)
dp[i][j]=1;
else
for(j=1;j<=m;j++)
if(a[i][j]>=a[i-1][j])
dp[i][j]=dp[i-1][j]+1;
else
dp[i][j]=1;
for(j=1;j<=m;j++)
len[i]=max(len[i],dp[i][j]);
}
scanf("%d",&k);
while(k--)
{
scanf("%d%d",&l,&r);
if(len[r]>=r-l+1)
printf("Yes\n");
else
printf("No\n");
}
}
return 0;
}
0 0
- 777C Alyona and Spreadsheet
- 777C Alyona and Spreadsheet
- C. Alyona and Spreadsheet
- C. Alyona and Spreadsheet
- cf 777c Alyona and Spreadsheet
- Codeforces 777C Alyona and Spreadsheet DP
- 【CodeForces 777C】Alyona and Spreadsheet
- 【codeforces 777C】 Alyona and Spreadsheet
- Codeforces 777C-Alyona and Spreadsheet
- 【Codeforces 777 C Alyona and Spreadsheet】
- codeforces 777C. Alyona and Spreadsheet (DP)
- CodeForces 777C Alyona and Spreadsheet
- codeforce 777C Alyona and Spreadsheet
- Codeforces 777C Alyona and Spreadsheet
- CF-777C Alyona and Spreadsheet
- codeforce 777c Alyona and Spreadsheet
- (codeforces)C. Alyona and Spreadsheet
- codeforce 777 C. Alyona and Spreadsheet (线段树)
- 微信企业号注册教程 视频教程 公众号 服务号 订阅号
- 解析json串的两种方式
- Android混淆、逆向
- HIVE下分布式生成整型唯一ID
- RecycleView实现footer功能
- 777C Alyona and Spreadsheet
- 如何快速学习一门程序语言?
- ScrollView嵌套Listview问题
- git命令行操作
- 爬虫之PermissionError: [Errno 13] Permission denied: 'ghostdriver.log'问题解决
- React Native 之
- APP测试功能点总结
- echart hightchart 区别
- 算法中的各种距离(欧式距离,马氏距离,闵可夫斯基距离......)