Submission #766881

#TimeUsernameProblemLanguageResultExecution timeMemory
766881tamyteTracks in the Snow (BOI13_tracks)C++14
2.19 / 100
168 ms31752 KiB
#include<bits/stdc++.h> using namespace std; void setIO(string name = "") { cin.tie(0)->sync_with_stdio(0); // see /general/fast-io if (name.size()) { freopen((name + ".in").c_str(), "r", stdin); // see /general/input-output freopen((name + ".out").c_str(), "w", stdout); } } void solve() { int n, m; cin >> n >> m; vector<vector<char>> arr(n, vector<char>(m)); bool fox = false, rabbit = false; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { cin >> arr[i][j]; fox |= (arr[i][j] == 'F'); rabbit |= (arr[i][j] == 'R'); } } cout << fox + rabbit << "\n"; } int main () { setIO(); int t = 1; // cin >> t; while (t--) { solve(); } }

Compilation message (stderr)

tracks.cpp: In function 'void setIO(std::string)':
tracks.cpp:8:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |         freopen((name + ".in").c_str(), "r", stdin); // see /general/input-output
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tracks.cpp:9:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |         freopen((name + ".out").c_str(), "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...