Submission #872202

#TimeUsernameProblemLanguageResultExecution timeMemory
872202TimAniTracks in the Snow (BOI13_tracks)C++17
2.19 / 100
31 ms34084 KiB
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <stack>
#include <queue>
#include <cmath>
#include <array>

using namespace std;

void setIO(string File_name) {
    cin.tie(0)->sync_with_stdio(0);
    if (File_name.size()) {
        freopen((File_name + ".in").c_str(), "r", stdin);
        freopen((File_name + ".out").c_str(), "w", stdout);
    }
}

void sol() {
    int w, h;
    cin >> w >> h;
    vector<string> g(w);
    for(int i = 0; i < w; i++){
        cin >> g[i];
    }
    if(g[0][0] == 'F'){
        cout << '2';
    }
    else if(g[0][0] == 'R'){
        for(int i = 0; i < w; i++){
            if(g[i].find('F') != string::npos){
                cout << '3';
                return;
            }
        }
        cout << '1';
    }
}

int main() {
    setIO("");
    int T = 1;
    //cin >> T;
    while (T--) sol();
    return 0;
}

Compilation message (stderr)

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