Submission #101505

#TimeUsernameProblemLanguageResultExecution timeMemory
101505ShaneOngTracks in the Snow (BOI13_tracks)C++14
2.19 / 100
101 ms16120 KiB
#include<bits/stdc++.h>
using namespace std;
int h,w;
char arr[4009][4009];
bool flag1,flag2;
int main(){
    scanf("%d%d",&h,&w);
    for(int x=0;x<h;x++)
        scanf("%s",&arr[x]);
    for(int x=0;x<h;x++){
        for(int y=0;y<w;y++){
            flag1=flag1||(arr[x][y]=='F');
            flag2=flag2||(arr[x][y]=='R');
        }
    }
    printf("%d\n",(flag1&&flag2)?2:1);
}

Compilation message (stderr)

tracks.cpp: In function 'int main()':
tracks.cpp:9:27: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[4009]' [-Wformat=]
         scanf("%s",&arr[x]);
                    ~~~~~~~^
tracks.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&h,&w);
     ~~~~~^~~~~~~~~~~~~~
tracks.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",&arr[x]);
         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...