Submission #1232345

#TimeUsernameProblemLanguageResultExecution timeMemory
1232345chrwnTracks in the Snow (BOI13_tracks)C++20
2.19 / 100
141 ms440 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)

tracks.cpp: In function 'void setio(std::string)':
tracks.cpp:29:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |     freopen((s+".in").c_str(),"r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tracks.cpp:30:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     freopen((s+".out").c_str(),"w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...