QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#140950#6115. Blocks and ExpressionsSorahISAAC ✓1ms3592kbC++207.4kb2023-08-17 00:56:522023-08-17 00:57:06

Judging History

你现在查看的是最新测评结果

  • [2023-08-17 00:57:06]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3592kb
  • [2023-08-17 00:56:52]
  • 提交

answer

#ifndef SorahISA
#define SorahISA
#include SorahISA __FILE__ SorahISA

int recur(auto &grid, int row, int col_L, int col_R) {
    for (int col = col_L; col <= col_R; ++col) {
        if (grid[row][col] != '.') {
            if (isdigit(grid[row][col])) return (grid[row][col] - '0');
            int ans_L = recur(grid, row+1, col_L, col-1);
            int ans_R = recur(grid, row+1, col+1, col_R);
            switch (grid[row][col]) {
                case '+': return ans_L + ans_R; break;
                case '-': return ans_L - ans_R; break;
                case '*': return ans_L * ans_R; break;
            }
        }
    }
    assert(false);
}

void solve() {
    int H, W; cin >> H >> W;
    
    vector<string> grid(H);
    for (string &str : grid) cin >> str;
    
    cout << recur(grid, 0, 0, W-1) << "\n";
}

int32_t main() {
    fastIO();
    
    int t = 1; // cin >> t;
    for (int _ = 1; _ <= t; ++_) {
        // cout << "Case #" << _ << ": ";
        solve();
    }
    
    return 0;
}

#else

#ifdef local
#define _GLIBCXX_DEBUG 1
#endif
#pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;

#define int int64_t
#define double __float80
using pii = pair<int, int>;
template <typename T> using Prior = std::priority_queue<T>;
template <typename T> using prior = std::priority_queue<T, vector<T>, greater<T>>;

// #define X first
// #define Y second
#define eb emplace_back
#define ef emplace_front
#define ee emplace
#define pb pop_back
#define pf pop_front
#define ALL(x) begin(x), end(x)
#define RALL(x) rbegin(x), rend(x)
#define SZ(x) ((int)(x).size())

template <size_t D, typename T> struct Vec : vector<Vec<D-1, T>> {
    static_assert(D >= 1, "Vector dimension must be greater than zero!");
    template <typename... Args> Vec(int n = 0, Args... args) : vector<Vec<D-1, T>>(n, Vec<D-1, T>(args...)) {}
};

template <typename T> struct Vec<1, T> : vector<T> {
    Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {}
};

template <class F>
inline constexpr decltype(auto) lambda_fix(F&& f) {
    return [f = std::forward<F>(f)](auto&&... args) {
        return f(f, std::forward<decltype(args)>(args)...);
    };
}

#ifdef local
#define fastIO() void()
#define debug(...) \
    _color.emplace_back("\u001b[31m"), \
    fprintf(stderr, "%sAt [%s], line %d: (%s) = ", _color.back().c_str(), __FUNCTION__, __LINE__, #__VA_ARGS__), \
    _do(__VA_ARGS__), _color.pop_back(), \
    fprintf(stderr, "%s", _color.back().c_str())
deque<string> _color{"\u001b[0m"};

template <typename T> concept is_string = is_same_v<T, string&> or is_same_v<T, const string&>;
template <typename T> concept is_iterable = requires (T _t) {begin(_t);};

template <typename T> inline void _print_err(T &&_t);
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I <  sizeof...(U), void>::type _print_err(const tuple<U...> &_t);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I <  sizeof...(U), void>::type _print_err(tuple<U...> &_t);
template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu);

inline void _do() {cerr << "\n";};
template <typename T> inline void _do(T &&_t) {_print_err(_t), cerr << "\n";}
template <typename T, typename ...U> inline void _do(T &&_t, U &&..._u) {_print_err(_t), cerr << ", ", _do(_u...);}
#else
#define fastIO() ios_base::sync_with_stdio(0), cin.tie(0)
#define debug(...) void()
#endif

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

inline int getRand(int L, int R) {
    if (L > R) swap(L, R);
    return (int)(rng() % ((uint64_t)R - L + 1) + L);
}

template <typename T, typename U> bool chmin(T &lhs, U rhs) {return lhs > rhs ? lhs = rhs, 1 : 0;}
template <typename T, typename U> bool chmax(T &lhs, U rhs) {return lhs < rhs ? lhs = rhs, 1 : 0;}

/// below are Fast I/O and _print_err templates ///

/*
/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///

#include <unistd.h>

const int S = 65536;

int OP = 0;
char OB[S];

inline char RC() {
    static char buf[S], *p = buf, *q = buf;
    return p == q and (q = (p = buf) + read(0, buf, S)) == buf ? -1 : *p++;
}

inline int RI() {
    static char c;
    int a;
    while (((c = RC()) < '0' or c > '9') and c != '-' and c != -1);
    if (c == '-') {
        a = 0;
        while ((c = RC()) >= '0' and c <= '9') a *= 10, a -= c ^ '0';
    }
    else {
        a = c ^ '0';
        while ((c = RC()) >= '0' and c <= '9') a *= 10, a += c ^ '0';
    }
    return a;
}

inline void WI(int n, char c = '\n') {
    static char buf[20], p;
    if (n == 0) OB[OP++] = '0';
    p = 0;
    if (n < 0) {
        OB[OP++] = '-';
        while (n) buf[p++] = '0' - (n % 10), n /= 10;
    }
    else {
        while (n) buf[p++] = '0' + (n % 10), n /= 10;
    }
    for (--p; p >= 0; --p) OB[OP++] = buf[p];
    OB[OP++] = c;
    if (OP > S-20) write(1, OB, OP), OP = 0;
}

/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///
*/

#ifdef local

template <typename T> inline void _print_err(T &&_t) {cerr << _t;}

template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>) {
    string _tmp_color = _color.back();
    ++_tmp_color[3], _color.emplace_back(_tmp_color);
    cerr << _color.back() << "[";
    for (bool _first = true; auto &_x : _t) {
        if (!_first) cerr << ", ";
        _print_err(_x), _first = false;
    }
    cerr << "]" << (_color.pop_back(), _color.back());
}

template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu) {
    string _tmp_color = _color.back();
    ++_tmp_color[3], _color.emplace_back(_tmp_color);
    cerr << _color.back() << "(";
    _print_err(_tu.first), cerr << ", ", _print_err(_tu.second);
    cerr << ")" << (_color.pop_back(), _color.back());
    return os;
}

template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &) {
    cerr << ")" << (_color.pop_back(), _color.back());
}

template <size_t I = 0, typename ...U> inline typename enable_if<I <  sizeof...(U), void>::type _print_err(const tuple<U...> &_t) {
    if (!I) {
        string _tmp_color = _color.back();
        ++_tmp_color[3], _color.emplace_back(_tmp_color);
        cerr << _color.back();
    }
    cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}

template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &) {
    cerr << ")" << (_color.pop_back(), _color.back());
}

template <size_t I = 0, typename ...U> inline typename enable_if<I <  sizeof...(U), void>::type _print_err(tuple<U...> &_t) {
    if (!I) {
        string _tmp_color = _color.back();
        ++_tmp_color[3], _color.emplace_back(_tmp_color);
        cerr << _color.back();
    }
    cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}

#endif

#endif

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3524kb

input:

1 1
5

output:

5

result:

ok 1 number(s): "5"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3452kb

input:

2 3
.-.
9.2

output:

7

result:

ok 1 number(s): "7"

Test #3:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

4 9
...*.....
.-.....+.
9.4..*..5
....7.2..

output:

95

result:

ok 1 number(s): "95"

Test #4:

score: 0
Accepted
time: 1ms
memory: 3528kb

input:

9 35
...............................+...
...........*.....................*.
.+.....................+........8.6
5........+...........-...+.........
.......*..1........*..0.0....*.....
...+....5....*......8......+..9....
..5..+......2..+..........4.9......
....5.9.......7..*.................
..........

output:

34489

result:

ok 1 number(s): "34489"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

9 31
.....................+.........
.................+.....+.......
...-...............*..2..-.....
.+.....*..........7.3...7....+.
4.1..-.........-...........*..5
....0.5......*..2.........8.8..
...........*..8................
.........+..2..................
........2.5....................

output:

516

result:

ok 1 number(s): "516"

Test #6:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

7 29
...........+.................
.......-.................*...
...*.....-.......+.........+.
.-...*..0.2....*...*......8.2
5.7.2.1......-..1.2..-.......
............8.3.....8..*.....
......................3.1....

output:

148

result:

ok 1 number(s): "148"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

5 13
...........-.
.....+......8
.*.....*.....
0..+..0..+...
..8.2...0.6..

output:

-8

result:

ok 1 number(s): "-8"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

7 21
.......+.............
.-.......*...........
4....-..5..........+.
...+..1....*........6
..8.0.....2....+.....
.............+...+...
............0.8.9.1..

output:

207

result:

ok 1 number(s): "207"

Test #9:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

5 13
.........*...
...-.......+.
.*.....+..2.4
9.5..+..0....
....6.1......

output:

228

result:

ok 1 number(s): "228"

Test #10:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

7 29
.................-...........
...........*.......-.........
.......+.......+..7........-.
.*.......*...-..1........+..1
0..-....6.0.7.6........-..1..
..5..*...............-..1....
....9.0.............4.8......

output:

-12

result:

ok 1 number(s): "-12"

Test #11:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

9 37
.....................*...............
...................*.......+.........
...........-........5..-...........+.
.........+.....+......3..+.....*....5
.+........7..-...+......1.4..-...-...
2......*....9.3.3.1.........2.8.2.2..
.....+..8............................
...+..6.........................

output:

1185

result:

ok 1 number(s): "1185"

Test #12:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

9 23
.-.....................
3..+...................
..3..............-.....
.....+...............+.
....9..+...........-..8
......4......*....9.5..
...........+...+.......
.........+..7.3.1......
........4.9............

output:

-81

result:

ok 1 number(s): "-81"

Test #13:

score: 0
Accepted
time: 1ms
memory: 3476kb

input:

12 37
.................................+...
...............................*...+.
...........................-....5.0.1
.........................+...*.......
...................+......6.5.9......
...+.................*...............
.*.....+............7..*.............
4.4..-...........*....1.8......

output:

371

result:

ok 1 number(s): "371"

Test #14:

score: 0
Accepted
time: 1ms
memory: 3504kb

input:

3 5
...+.
.*..2
9.3..

output:

29

result:

ok 1 number(s): "29"

Test #15:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

6 15
.*.............
0....*.........
...+.....*.....
..7.0..-...+...
......5.8.5..-.
............7.5

output:

0

result:

ok 1 number(s): "0"

Test #16:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

5 11
.........+.
.....+....7
.-.....+...
8..-..1.6..
..3.4......

output:

23

result:

ok 1 number(s): "23"

Test #17:

score: 0
Accepted
time: 1ms
memory: 3460kb

input:

8 23
.+.....................
4....................+.
.......-..............4
.....*.....+...........
...+..3..-.........-...
..5.9...4.1....-....5..
.............-...+.....
............5.1.8.3....

output:

59

result:

ok 1 number(s): "59"

Test #18:

score: 0
Accepted
time: 1ms
memory: 3476kb

input:

9 23
.*.....................
9....................+.
...................*..6
.......-............1..
.....+.....*...........
...+..8..+...-.........
..6.0...1.1.4....+.....
...............*..9....
..............1.0......

output:

270

result:

ok 1 number(s): "270"

Test #19:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

2 3
.-.
8.4

output:

4

result:

ok 1 number(s): "4"

Test #20:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

5 13
...-.........
.*.......+...
0.4....+...-.
.....+..6.8.1
....4.8......

output:

-25

result:

ok 1 number(s): "-25"

Test #21:

score: 0
Accepted
time: 0ms
memory: 3460kb

input:

6 33
.................+...............
.....+.....................*.....
...+.......+...........-.....+...
.-..4..*.......*.....-...-..7..-.
0.9...4..+...-..7..*..1.9.1...4.6
........9.4.7.5...2.8............

output:

96

result:

ok 1 number(s): "96"

Test #22:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

7 29
...............+.............
.........+.............+.....
.-.........-.........*.....-.
5..*......7..*.....-..4..-..9
..5..+......3.7..+..9...6.6..
....1..+........0.0..........
......2.1....................

output:

-74

result:

ok 1 number(s): "-74"

Test #23:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

6 17
...*.............
.-.........-.....
0.1......+.....-.
.....*....0..-..4
....0..-....9.9..
......0.6........

output:

-4

result:

ok 1 number(s): "-4"

Test #24:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

6 33
...............*.................
.......+.................*.......
.+.......+...........+.....*.....
7..*....6..-.......*...-..8..+...
..3..-....0..-...+..3.8.4...2..-.
....7.4.....7.2.7.8...........6.8

output:

0

result:

ok 1 number(s): "0"

Test #25:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

6 27
.............*.............
.....+...............+.....
.-.....*.......+.........+.
2..+..8....*..4..-.....+..0
..9.3....*..0...1..*..7.5..
........3.0.......6.3......

output:

10

result:

ok 1 number(s): "10"

Test #26:

score: 0
Accepted
time: 1ms
memory: 3528kb

input:

6 25
.........+...............
.......*.........-.......
.*......8....+.........+.
6....*.....*...-.....-..4
...*..3...1.1.7.4..*..6..
..8.7.............1.1....

output:

8069

result:

ok 1 number(s): "8069"

Test #27:

score: 0
Accepted
time: 1ms
memory: 3460kb

input:

6 15
.....+.........
.+.....+.......
6..-..3..+.....
..7.7...4..-...
..........1..-.
............8.1

output:

7

result:

ok 1 number(s): "7"

Test #28:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

10 37
.*...................................
5......*.............................
...*.......-.........................
..4..-...-...........-...............
....7.8.0.6........*...............+.
...............-....1..+............0
.............*...+....8......*.......
............0.7.0.4......*.....

output:

-3120

result:

ok 1 number(s): "-3120"

Test #29:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

8 37
.......-.............................
.*.................+.................
4....+...........*...*...............
...-..7......-....0.2............+...
..3.3....-.....-.............-.....-.
........9..-..9.6........*.....+..3.5
..........8.8..........-...*..3.1....
......................7.6.3.4...

output:

16

result:

ok 1 number(s): "16"

Test #30:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

8 37
.....................-...............
.................*.................-.
...+...............+.........-......3
.*.....+..........4.5......-.....+...
0.4..*.........+.......*....0..*..8..
....8.1....*....6.....1..*....4.8....
.........+...+..........7.1..........
........6.5.7.4.................

output:

1251

result:

ok 1 number(s): "1251"

Test #31:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

8 37
.........................-...........
...........+.................*.......
.........*.......+.........*.......-.
.+........8..+.......-....2.0..+....0
0..*........8..-...*...-......6..+...
..3..-........0.1.2.9.8.1.......3.4..
....0..+.............................
......1.5.......................

output:

-126

result:

ok 1 number(s): "-126"

Test #32:

score: 0
Accepted
time: 1ms
memory: 3540kb

input:

8 37
.....................+...............
...........-.............*...........
.........-...+.........+...........+.
.*........6.7..+......5.4....+......9
8......+......0..*.........-.....*...
.....-..6.......0..*......4.9..-..2..
...*..5...........9.5.........9.8....
..0.9...........................

output:

49

result:

ok 1 number(s): "49"

Test #33:

score: 0
Accepted
time: 1ms
memory: 3460kb

input:

10 37
...................................-.
.............................*......5
...+...........................-.....
.*.....................+......4..*...
6.4....-.................-......1.0..
.....+.......+..........2..+.........
....4.7..-.......*........1.4........
........2..-...+.....-.........

output:

-29

result:

ok 1 number(s): "-29"

Test #34:

score: 0
Accepted
time: 1ms
memory: 3576kb

input:

10 37
...............................+.....
.........................-.......-...
.....................-.....+....1..+.
.+.....................-..7..-....2.9
6..............*......0.7...7.8......
.......*...........*.................
...+.....+.......+..0................
..5..+..8..+....1.1............

output:

-3

result:

ok 1 number(s): "-3"

Test #35:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

12 37
...*.................................
.-.................................+.
1.3..............................+..9
.............................*....3..
.......+.......................-.....
.....*.....*..................9.6....
....0.0..*.....*.....................
........5.3..*.....-...........

output:

-384

result:

ok 1 number(s): "-384"

Test #36:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

10 37
...............................*.....
...........................*.....-...
.-...........................-..4..+.
9....-......................2.8...7.6
...-.................*...............
..8.6....-.............+.............
.......+.......-......5..-...........
......8.7..*.......*....7.1....

output:

19980

result:

ok 1 number(s): "19980"

Test #37:

score: 0
Accepted
time: 1ms
memory: 3532kb

input:

12 37
.....+...............................
...*...............................+.
.-..2..+............................7
0.3...2........................*.....
...........................*.....*...
.......................+.....+..3.9..
.........-...............-..3.7......
........1......*........1.6....

output:

-311037

result:

ok 1 number(s): "-311037"

Test #38:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

7 37
.................-...................
...........+.............-...........
.........*...-.........*.......-.....
...+......5.8..-.....+..5..-.......-.
.-.....-......4.2..*..0...3..*...-..0
9.7..+..0.........9.9.......8.5.6.1..
....8.1..............................

output:

-386

result:

ok 1 number(s): "-386"

Test #39:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

7 37
.....................+...............
.........+.....................-.....
.+.............-.............*.....*.
7..*.......+.....-.....+......3..+..6
..2....-..5..-..9..+..2..-......8.2..
.....+..8...6.4...2.8...4..-.........
....3.8...................3.5........

output:

-15

result:

ok 1 number(s): "-15"

Test #40:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

7 37
...................*.................
.............*.................-.....
.........*.....-...........*.....+...
.......-...-..8..+.....+.....+..9..+.
...-....6.9.0...0.3..+...-..4.9...1.6
.-...*..............5.1.5.3..........
6.7.6.3..............................

output:

-99000

result:

ok 1 number(s): "-99000"

Test #41:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

7 37
...............+.....................
...*.................*...............
.-.........+.......-.......*.........
9.0....+.....+...-..5..*.....-.......
.....+...-..5.1.6.3...4..-..3....*...
....8.7.4.4.............4.5....-...+.
..............................1.9.0.7

output:

661

result:

ok 1 number(s): "661"

Test #42:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

8 37
.....................*...............
.......+.................*...........
.....-...-.............*.....-.......
.*....6.7..-..........3.6..+.....-...
9..+......7....*..........4.1..-...*.
..8.0........-...*............1.4.9.1
............0.5.8..-.................
..................1.9...........

output:

118116

result:

ok 1 number(s): "118116"

Test #43:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

1 1
7

output:

7

result:

ok 1 number(s): "7"

Test #44:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

1 1
8

output:

8

result:

ok 1 number(s): "8"

Test #45:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

1 1
7

output:

7

result:

ok 1 number(s): "7"

Test #46:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

1 1
8

output:

8

result:

ok 1 number(s): "8"

Test #47:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

1 1
3

output:

3

result:

ok 1 number(s): "3"

Test #48:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

8 37
.......................*.............
...............*.............*.......
.............*.......*.....*...*.....
.......*......9..*....7..*..8.9..*...
.....*...*......9..*....9.9.....9..*.
.*....8.7..*......8.9.............9.7
9..*......9.9........................
..7.8...........................

output:

308616905200472064

result:

ok 1 number(s): "308616905200472064"

Test #49:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

8 37
...............................*.....
.............*.....................*.
.........*.......*...............*..7
.*.........*...*.............*..7.8..
8....*....9.8.9.9....*........9......
...*...*...........*.....*...........
..7.9.9.8.........7.8..*...*.........
......................7.8.9.9...

output:

189657576858451968

result:

ok 1 number(s): "189657576858451968"

Test #50:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

8 37
.............................*.......
...............*.................*...
.*.....................*.......*...*.
9..*.............*.........*..8.9.8.8
..7......*......7....*...*..8........
.......*.....*.....*..8.8.7..........
.....*..9..*..9...7.8................
....7.8...9.7...................

output:

116552255737430016

result:

ok 1 number(s): "116552255737430016"

Test #51:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

9 37
.*...................................
8....................*...............
...................*...........*.....
...............*....9..*.........*...
...........*.....*....9..*......7..*.
...*.........*..9.7.....9..*......7.7
..8....*....9.9...........8..*.......
.....*...*..................9...

output:

240035370711478272

result:

ok 1 number(s): "240035370711478272"

Test #52:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

7 37
...................*.................
.......*.......................*.....
.*.............*.....*.............*.
8....*.......*...*..7......*.....*..7
...*..7....*..9.7.8....*.....*..9.7..
..7.7....*..9.........9..*..8.7......
........7.8.............9.9..........

output:

87841018911485952

result:

ok 1 number(s): "87841018911485952"