답안 #872202

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
872202 2023-11-12T13:41:41 Z TimAni Tracks in the Snow (BOI13_tracks) C++17
2.1875 / 100
31 ms 34084 KB
#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

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);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 856 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 1 ms 604 KB Output isn't correct
5 Incorrect 0 ms 604 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Incorrect 0 ms 344 KB Output isn't correct
10 Incorrect 0 ms 600 KB Output isn't correct
11 Incorrect 0 ms 344 KB Output isn't correct
12 Incorrect 1 ms 604 KB Output isn't correct
13 Incorrect 0 ms 604 KB Output isn't correct
14 Incorrect 0 ms 604 KB Output isn't correct
15 Incorrect 1 ms 764 KB Output isn't correct
16 Incorrect 1 ms 860 KB Output isn't correct
17 Incorrect 1 ms 860 KB Output isn't correct
18 Incorrect 1 ms 604 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Incorrect 3 ms 3540 KB Output isn't correct
3 Incorrect 26 ms 33872 KB Output isn't correct
4 Incorrect 7 ms 8440 KB Output isn't correct
5 Incorrect 14 ms 19008 KB Output isn't correct
6 Incorrect 25 ms 33792 KB Output isn't correct
7 Incorrect 1 ms 604 KB Output isn't correct
8 Incorrect 1 ms 604 KB Output isn't correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Incorrect 0 ms 348 KB Output isn't correct
11 Incorrect 1 ms 604 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Incorrect 3 ms 3420 KB Output isn't correct
14 Incorrect 2 ms 2140 KB Output isn't correct
15 Incorrect 2 ms 2396 KB Output isn't correct
16 Incorrect 7 ms 1628 KB Output isn't correct
17 Incorrect 7 ms 8740 KB Output isn't correct
18 Incorrect 7 ms 8532 KB Output isn't correct
19 Incorrect 7 ms 7892 KB Output isn't correct
20 Incorrect 7 ms 7344 KB Output isn't correct
21 Incorrect 16 ms 19488 KB Output isn't correct
22 Incorrect 17 ms 19028 KB Output isn't correct
23 Incorrect 14 ms 16468 KB Output isn't correct
24 Incorrect 14 ms 19124 KB Output isn't correct
25 Incorrect 27 ms 33876 KB Output isn't correct
26 Correct 22 ms 25748 KB Output is correct
27 Incorrect 30 ms 33876 KB Output isn't correct
28 Incorrect 28 ms 33828 KB Output isn't correct
29 Incorrect 25 ms 33872 KB Output isn't correct
30 Incorrect 28 ms 33112 KB Output isn't correct
31 Incorrect 17 ms 21668 KB Output isn't correct
32 Incorrect 31 ms 34084 KB Output isn't correct