20598954    nmphy    D    答案正确    8    512    486    C++    2017-12-30 14:30:35
20598712    nmphy    E    答案正确    3    504    695    C++    2017-12-30 14:25:59
20598181    nmphy    E    答案正确    3    484    659    C++    2017-12-30 14:15:16
20597638    nmphy    E    答案正确    3    504    505    C++    2017-12-30 14:05:08//比赛时候这里显示的是WA,而且显示准确率5%
20597208    nmphy    F    答案正确    3    272    569    C++    2017-12-30 13:57:09
20596793    nmphy    H    答案正确    3    384    312    C++    2017-12-30 13:49:00
20596485    nmphy    J    答案正确    15    512    493    C++    2017-12-30 13:43:23
20596125    nmphy    G    答案正确    4    396    768    C++    2017-12-30 13:36:12
20596077    nmphy    G    答案正确    3    384    768    C++    2017-12-30 13:35:22
20595884    nmphy    G    答案错误    4    384    840    C++    2017-12-30 13:31:43
20595709    nmphy    G    答案错误    4    384    825    C++    2017-12-30 13:28:29
20595099    nmphy    I    答案正确    4    384    386    C++    2017-12-30 13:16:36
20594924    nmphy    K    答案正确    4    436    555    C++    2017-12-30 13:13:09
20594652    nmphy    D    段错误    3    384    485    C++    2017-12-30 13:07:57
20594225    nmphy    C    答案正确    71    3904    560    C++    2017-12-30 12:59:14
20594201    nmphy    C    答案正确    69    4028    560    C++    2017-12-30 12:58:48
20593760    nmphy    B    答案正确    3    512    553    C++    2017-12-30 12:49:38
20593541    nmphy    A    答案正确    516    13056    988    C++    2017-12-30 12:44:16

反正就是12.30左右知道他们有比赛,赶紧注册的。。14.30AK,(其中还有E题耽误的不少时间)排名第7。。。可见其题难道。。。难道我是难题渣。。。水题王。。。打表。。。贪心。。。

E题比赛时错了很多次,后来刷新后就A了。。。可能数据有点极端。(耽误了我20分钟。比完才告诉我A了,我以为10题挂机,结果AK了)。

A:

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=1010;
int x[maxn][maxn],y[maxn][maxn];
char ch[maxn][maxn],opt[10];
int main()
{
    int n,m,q,i,j,a,b;
    while(~scanf("%d%d%d",&n,&m,&q)){
        for(i=1;i<=n;i++)
         for(j=1;j<=m;j++)
          cin>>ch[i][j];
        for(i=1;i<=n;i++)
         for(j=1;j<=m;j++)
          x[i][j]=x[i][j-1]+(ch[i][j]=='#'?1:0);
        for(i=1;i<=n;i++)
         for(j=1;j<=m;j++)
          y[i][j]=y[i-1][j]+(ch[i][j]=='#'?1:0);
        for(i=1;i<=q;i++){
            scanf("%d%d%s",&a,&b,opt);
            if(opt[0]=='D'){
                if(y[n][b]-y[a-1][b]==0)  printf("YES\n");
                else printf("NO\n");
            }
            else if(opt[0]=='U'){
                 if(y[a][b]-y[0][b]==0) printf("YES\n");
                 else printf("NO\n");
            }
            else if(opt[0]=='R'){
                if(x[a][m]-x[a][b-1]==0)  printf("YES\n");
                else printf("NO\n");
            }
            else if(opt[0]=='L')    {
                if(x[a][b]-x[a][0]==0) printf("YES\n");
                else printf("NO\n");
            }      
        }
    } return 0;
}
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案