# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1232345 | chrwn | Tracks in the Snow (BOI13_tracks) | C++20 | 141 ms | 440 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
// #define f first
// #define s second
#define mod(a, b) (((a)%(b)+(b))%(b))
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9+7;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
void setio(string s="") {
ios::sync_with_stdio(false);
cin.tie(nullptr);
if (size(s)) {
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
}
#ifdef LOCAL
#include "debug.h"
#endif
void solve() {
int n,m; cin >> n >> m;
int f=false,r=false;
for (int i=0; i<n; ++i) {
for (int j=0; j<n; ++j) {
char c; cin >> c;
if (c=='F') f=true;
if (c=='R') r=true;
}
}
cout << f+r << '\n';
}
signed main() {
setio();
int tc = 1;
// cin >> tc;
while (tc--) {
// cout << "tc 1:\n";
solve();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |