Submission #1120568

#TimeUsernameProblemLanguageResultExecution timeMemory
1120568vjudge1Tracks in the Snow (BOI13_tracks)C++17
2.19 / 100
246 ms16460 KiB
#include <bits/stdc++.h>
using namespace std;

#define ld double


const int INF = 1e18;
const int mod = 12345;
const int sz = 4e3 + 5;

char a[sz][sz];

int main()
{
   ios_base::sync_with_stdio(0);cin.tie(0);
   int n , m;
   cin >> n >> m;
   int cnt1 = 0 , cnt2 = 0;
   for(int i = 1;i <= n;i++){
    for(int j = 1;j <= m;j++){
        cin >> a[i][j];
        if(a[i][j] == 'R') cnt1++;
        if(a[i][j] == 'F') cnt2++;
    }
   }
   if(cnt1 == 0 && cnt2)
   {
       cout << 1 << endl;
   }
   else if(cnt1 && cnt2 == 0)
   {
       cout << 1 << endl;
   }
   else if(cnt1 == 0 && cnt2 == 0)
   {
       cout << 0 << endl;
   }
   else{
    cout << 2 << endl;
   }
}

Compilation message (stderr)

tracks.cpp:7:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    7 | const int INF = 1e18;
      |                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...