답안 #757747

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
757747 2023-06-13T17:33:14 Z drdilyor Tracks in the Snow (BOI13_tracks) C++17
0 / 100
1012 ms 1034492 KB
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    vector<string> mat(n);
    for (string& s : mat) {
        cin >> s;
        s.resize(n);
    }

    int di[]{0, 0, -1, 1};
    int dj[]{-1, 1, 0, 0};

    vector vis(n, vector<bool>(m));
    int cnt = 0;
    auto dfs = [&](auto& dfs, int i, int j)->void {
        cnt++;
        if (!(cnt & (1<<20)-1)) cout << cnt << endl;
        vis[i][j] = 1;
        for (int d = 0; d < 4; d++) {
            int ei = i + di[d];
            int ej = j + dj[d];
            if (0 <= ei && ei < n && 0 <= ej && ej < m && !vis[ei][ej])
                dfs(dfs, ei, ej);
        }
    };
    dfs(dfs, 0, 0);

    return 0;
}

Compilation message

tracks.cpp: In instantiation of 'main()::<lambda(auto:23&, int, int)> [with auto:23 = main()::<lambda(auto:23&, int, int)>]':
tracks.cpp:32:18:   required from here
tracks.cpp:23:28: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   23 |         if (!(cnt & (1<<20)-1)) cout << cnt << endl;
      |                     ~~~~~~~^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 15956 KB Output isn't correct
2 Incorrect 1 ms 316 KB Output isn't correct
3 Incorrect 1 ms 468 KB Output isn't correct
4 Incorrect 9 ms 10324 KB Output isn't correct
5 Incorrect 5 ms 5716 KB Output isn't correct
6 Incorrect 1 ms 340 KB Output isn't correct
7 Incorrect 1 ms 468 KB Output isn't correct
8 Incorrect 1 ms 596 KB Output isn't correct
9 Incorrect 1 ms 852 KB Output isn't correct
10 Incorrect 4 ms 4436 KB Output isn't correct
11 Incorrect 3 ms 2880 KB Output isn't correct
12 Incorrect 5 ms 5844 KB Output isn't correct
13 Incorrect 5 ms 5716 KB Output isn't correct
14 Incorrect 5 ms 5716 KB Output isn't correct
15 Incorrect 15 ms 16436 KB Output isn't correct
16 Incorrect 13 ms 15956 KB Output isn't correct
17 Incorrect 14 ms 15700 KB Output isn't correct
18 Incorrect 9 ms 10444 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 18132 KB Output isn't correct
2 Incorrect 104 ms 100880 KB Output isn't correct
3 Incorrect 1008 ms 1023724 KB Output isn't correct
4 Incorrect 225 ms 240796 KB Output isn't correct
5 Incorrect 554 ms 577240 KB Output isn't correct
6 Incorrect 967 ms 1024712 KB Output isn't correct
7 Incorrect 12 ms 19156 KB Output isn't correct
8 Incorrect 11 ms 18108 KB Output isn't correct
9 Incorrect 4 ms 4052 KB Output isn't correct
10 Incorrect 2 ms 2280 KB Output isn't correct
11 Incorrect 12 ms 18828 KB Output isn't correct
12 Incorrect 2 ms 1740 KB Output isn't correct
13 Incorrect 96 ms 101120 KB Output isn't correct
14 Incorrect 57 ms 58520 KB Output isn't correct
15 Incorrect 65 ms 64892 KB Output isn't correct
16 Incorrect 38 ms 41684 KB Output isn't correct
17 Incorrect 256 ms 263828 KB Output isn't correct
18 Incorrect 231 ms 256976 KB Output isn't correct
19 Incorrect 225 ms 240836 KB Output isn't correct
20 Incorrect 219 ms 221068 KB Output isn't correct
21 Incorrect 558 ms 603836 KB Output isn't correct
22 Incorrect 568 ms 576352 KB Output isn't correct
23 Incorrect 499 ms 496324 KB Output isn't correct
24 Incorrect 527 ms 589796 KB Output isn't correct
25 Incorrect 975 ms 1023752 KB Output isn't correct
26 Incorrect 757 ms 785508 KB Output isn't correct
27 Incorrect 965 ms 1034492 KB Output isn't correct
28 Incorrect 1012 ms 1034260 KB Output isn't correct
29 Incorrect 968 ms 1034376 KB Output isn't correct
30 Incorrect 920 ms 1012596 KB Output isn't correct
31 Incorrect 619 ms 656072 KB Output isn't correct
32 Incorrect 980 ms 1026340 KB Output isn't correct