# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
885392 | hihihihaw | Tracks in the Snow (BOI13_tracks) | C++17 | 58 ms | 16104 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
#define endl "\n"
#define pb push_back
#define pii pair<int,int>
#define tiii tuple<int,int,int>
void solve(){
int h,w;
cin>>h>>w;
char a[h][w];
string b;
for (int i=0;i<h;i++){
cin>>b;
for (int j=0;j<w;j++) a[i][j]=b[j];
}
int f=0,r=0;
for (int i=0;i<h;i++){
for (int j=0;j<w;j++){
if (a[i][j]=='R') r=1;
if (a[i][j]=='F') f=1;
}
}
cout<<f+r;
}
int32_t main() {
ios_base::sync_with_stdio(0);cin.tie(0);
if (0){
freopen("herding.in", "r", stdin);
freopen("herding.out", "w", stdout);
}
int t=1;
if (!t)cin>>t;
while(t--){
solve();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |