QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73564#5270. Easily Distinguishable TrianglessinbadAC ✓23ms5212kbC++5.2kb2023-01-25 22:25:332023-01-25 22:25:36

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-25 22:25:36]
  • 评测
  • 测评结果:AC
  • 用时:23ms
  • 内存:5212kb
  • [2023-01-25 22:25:33]
  • 提交

answer

// #define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const multiset<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

template <class T> auto vect(const T& v, int n) { return vector<T>(n, v); }
template <class T, class... D> auto vect(const T& v, int n, D... m) {
  return vector<decltype(vect(v, m...))>(n, vect(v, m...));
}

using int64 = long long;
using int128 = __int128_t;
using ii = pair<int, int>;
#define SZ(x) (int)((x).size())
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
// const int MOD = 1e9 + 7;
const int MOD = 998244353;
mt19937_64 mrand(random_device{}());
int64 rnd(int64 x) { return mrand() % x; }
constexpr inline int lg2(int64 x) { return x == 0 ? -1 : sizeof(int64) * 8 - 1 - __builtin_clzll(x); }
constexpr inline int p2ceil(int64 x) { return 1 << (lg2(x - 1) + 1); }
template <class T> void out(const vector<T>& a) { for (int i = 0; i < SZ(a); ++i) cout << a[i] << " \n"[i + 1 == SZ(a)]; }
template <class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template <class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template <class T> void dedup(vector<T>& v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); }
inline void add_mod(int& x, int y) { x += y; if (x >= MOD) x -= MOD; }
inline void sub_mod(int& x, int y) { x += MOD - y; if (x >= MOD) x -= MOD; }
inline int mod(int x) { return x >= MOD ? x - MOD : x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; ++i) cin >> s[i];

  int ret = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0, k; j < n; j = k) {
      for (; j < n && s[i][j] != '?'; ++j);
      if (j == n) break;
      int len = 1;
      for (k = j + 1; k < n && s[i][k] == '?'; ++k) ++len;
      int L = j == 0 ? 0 : (s[i][j - 1] == '#' ? 1 : 0);
      int R = k == n ? 0 : (s[i][k] == '#' ? 1 : 0);
      trace(len, L, R);
      if (L != R) {
      } else {
        if (L == 1) {
          cout << 0 << '\n';
          return 0;
        }
        ret = 1LL * ret * (len + 1) % MOD;
      }
    }
  }

  vector<string> t(n, string(n, ' '));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) t[i][j] = s[j][i];
  }
  swap(s, t);
  trace(s);
  for (int i = 0; i < n; ++i) {
    for (int j = 0, k; j < n; j = k) {
      for (; j < n && s[i][j] != '?'; ++j);
      if (j == n) break;
      int len = 1;
      for (k = j + 1; k < n && s[i][k] == '?'; ++k) ++len;
      int L = j == 0 ? 0 : (s[i][j - 1] == '#' ? 1 : 0);
      int R = k == n ? 0 : (s[i][k] == '#' ? 1 : 0);
      trace("vert", len, L, R);
      if (L != R) {
      } else {
        if (L == 1) {
          cout << 0 << '\n';
          return 0;
        }
        ret = 1LL * ret * (len + 1) % MOD;
      }
    }
  }

  cout << ret << '\n';

  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3468kb

input:

2
.?
?#

output:

4

result:

ok 1 number(s): "4"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3420kb

input:

3
#??
#??
?##

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

3
.#.
#?#
.#.

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

1
.

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3372kb

input:

1
#

output:

1

result:

ok 1 number(s): "1"

Test #6:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

1
?

output:

4

result:

ok 1 number(s): "4"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3368kb

input:

2
?.
?.

output:

12

result:

ok 1 number(s): "12"

Test #8:

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

input:

3
?.?
.#?
?.?

output:

256

result:

ok 1 number(s): "256"

Test #9:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

5
?????
.?.#.
???#?
?##??
?.?.?

output:

12288

result:

ok 1 number(s): "12288"

Test #10:

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

input:

10
...###???.
?.???.??#.
??.?????..
.#..?.????
???...?..?
.???.?..??
??.????.??
.????.?.??
#.????.?#?
?.##???#??

output:

0

result:

ok 1 number(s): "0"

Test #11:

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

input:

10
..?.??????
.?.?.?.?..
???#????.?
??#.??.??.
?..???.?#.
.????.?.??
?...?.#???
?.?..???.?
?.?..??.??
###..#.??#

output:

453983775

result:

ok 1 number(s): "453983775"

Test #12:

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

input:

100
.........?...........................................?...?.....?...................#??..??......?...
......?....................................?...?..?...?...?..??......?...?#......?............?.?.?.
.....??........??............?........?..............?...?..?.............................?......

output:

882086962

result:

ok 1 number(s): "882086962"

Test #13:

score: 0
Accepted
time: 16ms
memory: 5072kb

input:

1000
?..???.?.......?.????.??.???.....??.????.??.??.?.?..??.?....?.??.?.??..?.?.?.?..??...?.?.???..?.#..??...?.??..????..???...??.....??.???.?.???.??.??.?....???.?????...?????..?..?..??.?.?.?...?.?????....?..?.??..??....??.?.??....?..?.??...???..??...?.???????..?....?.?.???..??.?..???..?..????.?.???...

output:

74184164

result:

ok 1 number(s): "74184164"

Test #14:

score: 0
Accepted
time: 3ms
memory: 5064kb

input:

1000
..........................................................................................................................................................................................................................................................................................................

output:

1

result:

ok 1 number(s): "1"

Test #15:

score: 0
Accepted
time: 3ms
memory: 5144kb

input:

1000
#######################################################################################################################################################################################################################################################################################################...

output:

1

result:

ok 1 number(s): "1"

Test #16:

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

input:

1000
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

219193901

result:

ok 1 number(s): "219193901"

Test #17:

score: 0
Accepted
time: 3ms
memory: 5032kb

input:

1000
.#####.###..##...#....#####..#.#.##.#...#.##.......#.###########.###..#.##..#..#######.####....#.....#.##.....#....###....#####..##.#####.#.#####.#.#.#..#.##.#.#.##..##.##.#...#....####.#####.#.#.##.#####.##.#.##..##.#.#######....##...##..#.###.#..#..##..#.#...###.#..#...#.#...###......#.#...##...

output:

1

result:

ok 1 number(s): "1"

Test #18:

score: 0
Accepted
time: 6ms
memory: 4412kb

input:

1000
#?#?##?####?#??#???##??##?#?##?###?###????###?????###?#?###?##?####?##?#?#???###???#??##???###?###?#?##?##??#?##?###???##????#####???#####?#???#####?#?#?#??#?#???#???#??#######???#?#??###?##?????#????###?##???????##???###?#???##???#?######??#?#??#????##??###??###?#######?##?#???##?##???#??##?##...

output:

0

result:

ok 1 number(s): "0"

Test #19:

score: 0
Accepted
time: 13ms
memory: 5020kb

input:

1000
??.???.??..???....?...?..???.??.?...??.?.?.?....?....???.????.?..?.???..???.?.???....?...?.?.?.????.?...?..?.?.?...??.?..??.?.?.?.?..???.??..???????????..???...?...?..?..?.???...?.?.??..?.?..?..????...??.??...?..??....?.???....???.??...??...?.....??..??...??...??..?...??...??..???....??.....?.?...

output:

411081010

result:

ok 1 number(s): "411081010"

Test #20:

score: 0
Accepted
time: 8ms
memory: 5156kb

input:

1000
???????????.???????????????.?.????????????.???????????????????????.???.???????????????..??.???????????????????????.??????.??????.????.???.??????????.????????????????.????.????????????????????.?????????????.?.??????????????????????.?????????????????????????????????????.???????????.?????????.????...

output:

283085945

result:

ok 1 number(s): "283085945"

Test #21:

score: 0
Accepted
time: 9ms
memory: 5212kb

input:

1000
??????????????.?????????????.??????????????????????????????????????????????????????????????????????????????????????????.????.??????????????????????????????????????.???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

845505829

result:

ok 1 number(s): "845505829"

Test #22:

score: 0
Accepted
time: 9ms
memory: 5036kb

input:

1000
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

290495287

result:

ok 1 number(s): "290495287"

Test #23:

score: 0
Accepted
time: 9ms
memory: 5152kb

input:

1000
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

329366395

result:

ok 1 number(s): "329366395"

Test #24:

score: 0
Accepted
time: 5ms
memory: 5152kb

input:

1000
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

148797428

result:

ok 1 number(s): "148797428"

Test #25:

score: 0
Accepted
time: 4ms
memory: 4100kb

input:

653
????.?.?.????.?????..?????#???????.?????#???.?.??????.??????.???????.???#???..?????#?????.???.?.???.???????.????.???????#.??????##???.??#.?.??.????????.????????#??????.???.????????#?.??.#???.?????????????##????????.??.?#??.??????????????????###???????.#??????????.#????.?.?????.??????????????????...

output:

333100622

result:

ok 1 number(s): "333100622"

Test #26:

score: 0
Accepted
time: 12ms
memory: 5208kb

input:

1000
#??.????#?????????????????????????.#?????????????.???.???????.????#.?????????.????#??.?????????##?????????????????????.????.?.??????.????#??.???#??.#????..?????????????????#???????..??.?????###???.?????????????#???????.?#?.??##..???????.#?.?.??.?????????????.??????????.?.?#??.?#?.???????#.?????...

output:

783725733

result:

ok 1 number(s): "783725733"

Test #27:

score: 0
Accepted
time: 5ms
memory: 3664kb

input:

373
.????..#.?#???.???.?????????#?.??#?.??????????.????#???..?#.??#?.???.??????????#???????.?.?.??.??????.?.?????#???.????..???.?????????.??#??.#??????.??.##..??.??????#???.???.?#???????..????????.?????????.???.##?.???#???.??##???????????????????.#????.?#?????????????????????????.?.??.???.?.????????...

output:

663414612

result:

ok 1 number(s): "663414612"

Test #28:

score: 0
Accepted
time: 15ms
memory: 5172kb

input:

1000
###?...#.?#.?#..?#??.#???.?????.??????#???????????.#.?.?.?.?????????????.?.?..???#??.????#????.???????????.??#???????.???.?.???#?.???.???##?.?#.#????.??.???.??????.??.?..???#?.##.?.?.#.?.??#???????????????.???#.?.??????.??????##.??????????#.???.?.#?.??????.#.?.??????????#????.#?.?????????????.?...

output:

580221572

result:

ok 1 number(s): "580221572"

Test #29:

score: 0
Accepted
time: 7ms
memory: 3904kb

input:

501
#.?.??.#.??..?.??????.??#??..??.???#?..??#????.?#.?????##.????.###.??#???.??????????###.?#?????.?..??.#????.???.?.???.?????#.?#.????..##.????..???#.???#????..????#.?.???#.??#?.??.?.??#????.?..?#?.#.##.??????.?????.?.????..??#??.#..?#.?????##?.##..?????#?.#??????.?#?..???????#.??..????????#??????...

output:

932879967

result:

ok 1 number(s): "932879967"

Test #30:

score: 0
Accepted
time: 23ms
memory: 5024kb

input:

1000
#.?????#.?#?.??..???.??????#??.??.?.?.#???.?????###??.?##??..??#.???.?????##.?#??.????#??.??#....?###??????.##.#.#??..?..??.?#??.?#?.????#???.#?.??????##??.????.????.??.????.????.?.?##.??.???.??.???.#??.??##.??##??.?#???????..#..????????##?.?#?.#.????.???#..#.???#????.?#.?#??..???#??.?#????????...

output:

105267212

result:

ok 1 number(s): "105267212"

Test #31:

score: 0
Accepted
time: 13ms
memory: 3992kb

input:

629
??#?..#.#.?.?.?.##.?#.#???.??##?.?##?.?..?????##?.##.?#####.#??.??..??##?.???#.?.#..#?.###???..????.?#?..##?..?.#?.###.?.??#????.#..??###.???.????.?.?###.?###?.??????.?.????.???#?????.?.#.?###?.??#.?###?.???.??.##.??????.??.???##.?.?.?###?...?.?.?#??.???##?.#.??#??...#.??####.?.??.?.#?.???.#.?#....

output:

352165579

result:

ok 1 number(s): "352165579"

Test #32:

score: 0
Accepted
time: 13ms
memory: 5024kb

input:

1000
.?#?.??#??.?.#?.?#?.??.#??.?.#####.#?.##..??.???#???.??..????.?#..#???..?#?..??##???..??????#.?#.???...##?..?#?..?#.??.?.##.?..???.??.?#.#.???..#??...??##.?..??.#.?#.#.?.????.????##.#.???.??#??.#???.??????.?.??#??.???#???.??.?##???.#????????.??.?##??.??#?.?.#?.??##.##?.?.??#?.#?.#??...??#????.....

output:

791485202

result:

ok 1 number(s): "791485202"

Test #33:

score: 0
Accepted
time: 2ms
memory: 3680kb

input:

309
????.??????????.#.????#.??#??.??.???.???#???..???#???..?.?#..?.???????.??.??.?????????.#???????.???.??..????#?.?.?.???????.?.???.??.???.??????.???#?.?????..?.??#?.????.??????????..?#??.?.?.????.?.??????.?????#???????????????..???.##???..?.??.?.?.??????#??????.?.????.??#???..???#???.??????..???.?...

output:

147352727

result:

ok 1 number(s): "147352727"

Test #34:

score: 0
Accepted
time: 16ms
memory: 5072kb

input:

1000
??????#???????.#?.?????...??...???????.????????#???.??.???.??.???##.??..?.???#??.??....?????.?.?.?????????##...???..?#...???.???????##?????.?.#??????????????????????.?????.?.??????.????#.#?.??.?.??.???#..?????#????..?.?????#.??#?.??.??#..?.????.?#.?????.???#????.??????#?.??##..?..?????.?#??..??...

output:

237888114

result:

ok 1 number(s): "237888114"

Test #35:

score: 0
Accepted
time: 3ms
memory: 3764kb

input:

437
#..??????????.???#.?.??#.??.??..??.?##..?#..#.?#...????...??????.?.????..#??.?..?.???#.#??????????????????..##.????#??.?##.??##?????.????#??????.??#?.#?.#???.?#????.??....#?.??..?.##??.??.????.????..#?.#..?.#????..?...??.?..?.???#??.#?????..??.?#.???????.???.?.##?..??.???.?.??????#?.???##???.??....

output:

635064633

result:

ok 1 number(s): "635064633"

Test #36:

score: 0
Accepted
time: 18ms
memory: 5028kb

input:

1000
?##??.??#???.#?????.??.#.??.?.????..??#?...???##..???#.?.###???.????.????#??..##?.?.??#??.??#?????.??.?.?????.????.?#..?#?.?##?.?##?????.?.#??..??..??#??..##???.?????#?.##?.??????###??????????.#???...?.????.???#.#.?#...??????#?.?.?.?.?#.?.###?...????.?.??.?.??..#??.##.??.?.?#..????...???????###...

output:

167395452

result:

ok 1 number(s): "167395452"

Test #37:

score: 0
Accepted
time: 18ms
memory: 4512kb

input:

861
.##??.###?..?#??.#?.?.?.?.??#????.??#.??#..??.?.??#..??#..?.????###.?.?..????#?.???.#?.?.????.?#####.?..?#??.????.??#.??...???..?.?.??#?????.#.?.???##???.......??#..#.????.?##.###.?##?.#?.?.#?.????#?.???.#.#.??????.?.##.??#?..???#???.#?..?#.??.?.??#.?###????..?##????.??????..?###.?..?#.?#?.?????...

output:

608860292

result:

ok 1 number(s): "608860292"

Test #38:

score: 0
Accepted
time: 11ms
memory: 5128kb

input:

1000
?.?..?.?#?.#.???#????.??#??..??#.?#?.?..????#?.#????.??#.#?.??#???????.?#???..???####????.???.?##.?##.??#?.?..#??.?????.?#??.???#???.?.?.?##??.???.?.?#????????.?..##.??.??..?....??.??????.???.????.##??.#????.??.????#??....??????..?????#?.?##.###??.?####.#?..?#??.#.???.?##??.#.?#.?.???#.?.####?....

output:

542489178

result:

ok 1 number(s): "542489178"

Test #39:

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

input:

285
.?##.?##.##..??.?#####?.####....?.#?.#.#.?#.????#??????.#?.?.?#.??#.????#??.?##?.????..?#??.?..?#??..?#..?##..?...##..#.?..##???.?????#.?#?.?#??.?.??##???.....???..??.?...?##??.?..###??.####?.?##.?.?.#.?.#.?..?..###??.##??.?#.???.#.##...??.?.###?.??##.?.?##???.#.#.?.?#.??...#?..??##?.
?#..#??.?....

output:

245977859

result:

ok 1 number(s): "245977859"

Test #40:

score: 0
Accepted
time: 22ms
memory: 5208kb

input:

1000
??##??.?.?....#??.?#.???##????.????#.?.?.#?.??.#?.##?.?##..?###??..?...##?.##.?#.#.#.#.#??.??.#??..??.?.???.#??..??.#?.?????.##?.????##.???#....?#..#.#.?##.#.#.?#.?#....##??.#??..###?.??#.?##??.#?.##????.?.?.?##.###?.??##?.?#.??..?#.#?.???#???.#.?.??#?.#.?#..##.?###???.##...#.?..#?..?##?.#.?###...

output:

60167919

result:

ok 1 number(s): "60167919"

Test #41:

score: 0
Accepted
time: 8ms
memory: 3800kb

input:

477
??#?..???.#??.?.?.?.?.???.#...#??.????.?#?...???.?.#??.?.?.?????????????#???.?????..?#???????..?????..??????.??..?.??.??.???????..?#??????...?...??.?.?.???????.??????##?.???...#?...?.?.?..???#?..?.....?..???#.?..??#.??...??????.##?..?#..?.?#.#.????....##?.?..?#????????.??#.???#?????.??#???.????....

output:

374654830

result:

ok 1 number(s): "374654830"

Test #42:

score: 0
Accepted
time: 15ms
memory: 5072kb

input:

1000
.?....?.?#?.?.???.#??.????????...???.#.???#.?#???.??.#.??##??.???#...?..#?.??..?.?.??.##??.??????#?.?.????????#..??.?.?#?.?#?.##?.???..?????.?.??#.??..?.???.?#?.??.?.????##?????.???...?.?.??????#.#?..??..?..#..??????.???.??.??.?#???..?##..?.#??.???...?..#?..?##.???????#?.??.?.?#?.??.??.?#..#......

output:

539027202

result:

ok 1 number(s): "539027202"

Test #43:

score: 0
Accepted
time: 10ms
memory: 3920kb

input:

605
#.?#??????.#.????..##?.??.???.???#....?#?..?#?.???#?.?...#?.#??...#.?#.??.??..#.??#..????????.??#..?#...?##?.?#???...?..????##..?#??.??.?.#.?#?..?#?..###?.???#.??..#??.??.?#.#???..????.?#..?.?...?..?#....?#?.??????????##??.?.??..?.??##.?.#..?...????.?.?.?.?.????.?.?...????????.??#?..??#.?.??###?...

output:

237663713

result:

ok 1 number(s): "237663713"

Test #44:

score: 0
Accepted
time: 18ms
memory: 5152kb

input:

1000
.##.?##.##?.#?.???#..?.??#?.###????.##.......?????#.??.?.#?...#?.????.?..?.?..?##.??.??.?#.????.?.#?.#??.?...?????..#?.??.?.???.?.????#?????.#..##.#.?....#???.#?..???.??.???#.#?...??#.?.???.?#...#.?.??#???.?????#.?.??#?..###.?.????#???..??.#.??..?#.?#.??.??.?.???#.#?..?..?.??.?..?##??????..?.?....

output:

98816482

result:

ok 1 number(s): "98816482"

Test #45:

score: 0
Accepted
time: 4ms
memory: 3608kb

input:

325
.#?.?.?????.??..#.??.?.?##.#??.#.?#..#.?.??#.###.#?.???..?#??.######...#?.??.#..?#.?#.??#??.??...#.##.?..?.#...??#??.?.#????..?.???.?.#.??##.#.#...?..?#..?.??.????..##.#.?#..?#?.?##.??#.?#..??#?.#.#?.???.....#..#..??#.?#.#..??.#.???.##?.?##??.##?.??#.?#..??.#.#?..?.??????#.?#??.#..??#.#??.#??.?....

output:

406888362

result:

ok 1 number(s): "406888362"

Test #46:

score: 0
Accepted
time: 18ms
memory: 5032kb

input:

1000
..?##??.###?...?#.#?.#..?.?#?.?.?.?###.????.??..#..###?..#.?.?.?#????.#.?.#?..?.?#?..?.#...??.##..?..?..???.??#??..??.?.??#.###?.?.?##.?.?###?.?#...#..?.?.#.?##?..?.??##?.##..?.##.###.###?...?.??#??.??#.??????##??......?#?.#?.#??...?.?#..?##?.?.#.?.?.??...?.??#?..#...??#..?.?.??.?.?.##??..?##.....

output:

343712117

result:

ok 1 number(s): "343712117"

Test #47:

score: 0
Accepted
time: 6ms
memory: 3756kb

input:

453
...#.#?.?.#..###?.#.?##?.#.?#.?.#??....#.#???.#.?...#.?##..#.#.#?..?..?#.#?.???#.##.?.??#?...?#?.??.?#.#..???#..##?.?.##.#???.#?..??#.###..?#.?#?.?.#.##?..?.?##.?#.??.?..#.??#?.###?.?##...?#..?##..##.?#..#.#...?.?.?#...?###..?.#.?#..#.????###.#..??###???.?##.?...######.#.?.?.#.???#.####.????##.#...

output:

566128872

result:

ok 1 number(s): "566128872"

Test #48:

score: 0
Accepted
time: 12ms
memory: 5068kb

input:

1000
..#?....####.#?.?###?.?.????#..?##..#?.#.###.?#..#.#..?#####.#.##..?#..??#??...??#..####...?...??..???.?#?.?.???.???##?..#.....##.#??.###.?.#.?.#.#?.?....??#?.###...#....#...#.????#.#?.#.#.?#.?.#.???##...??#.?.##.??.#.#.?..?#?.??#.?.??.??..?#??..##.#?.##?.#.##....##.?#.#....?.##?.?.###.?#?.?##....

output:

316920556

result:

ok 1 number(s): "316920556"

Test #49:

score: 0
Accepted
time: 3ms
memory: 3440kb

input:

134
???.#?.?..????..????..???..?#?.?.?.??#??..??...??.??.?#...?#??.???#????.?..#...?#.?????????.?.#?.??????.?...?.?....#....?#...?.?.???..
?#.????..??.????.??..???????????..#??...?.?.?.?#.#??...?..???.?.?.#?...#?.?.?..#.?..???#?.#..????.??.....??.?..?#??..?#.????#?..#?..?.
?#??..??.????..??...?.?......

output:

580715970

result:

ok 1 number(s): "580715970"

Test #50:

score: 0
Accepted
time: 22ms
memory: 5076kb

input:

1000
??.??.?#????...??#.?##?.?.??#????...?...??.?...?.?..?...?.?....??...?..??.???.?.????..?..?.???#??..#??...?.?.??..??.??????.???..?.?.????...???.?....???????....??..??.?#????...?.??.????.??.?.?.???.?..???.#???..??.?...??.??#..?.??.....??..?#?..??.....????..?...?.........#?.?..?.#??.?????.?#????.?...

output:

246110752

result:

ok 1 number(s): "246110752"

Test #51:

score: 0
Accepted
time: 3ms
memory: 3656kb

input:

262
#..??..?..###..?.?#??.??..?#..?...???#.#..?..?....?.??...?#?.#.?......?..?.?.#???..?..???.?.???#...#???.???????.?...?#?......#..???...??..??..???.??.?#?.??.?.????###??.??.??#.?.....#.#..##?.?#..?.?#?...?.?.?.#..??..???.?..???..???##.##.?#..???.?..?.#????.#??.#?.
..?##?.?.?#???.?...?????.##...?.....

output:

464019932

result:

ok 1 number(s): "464019932"

Test #52:

score: 0
Accepted
time: 22ms
memory: 5072kb

input:

1000
###?.#.#???..?#.??..?.#??.?.??.##..??..?..???#.?..?#.#.?.#.??#.#???.?.?#?.??..??..#???...#.?....#.#?.?#???????..#.#..#...#.??.??.#...???#.???......?.#?.?.?.?#.?#...?..??...?...?????.?#..#?.???....?.#??????.?#.#??.??#??????..#???...?#.?#.#?..?##.?.?..?.#??.....??#..?#??...????.#?.?.#..?.???#..??...

output:

547740315

result:

ok 1 number(s): "547740315"

Test #53:

score: 0
Accepted
time: 5ms
memory: 3748kb

input:

390
.#.#.?.?.?..?##......??.?....#.?...#?..?#?.?#?..?..?.?.....#?...#..?.?#.#?.?.?..??....?.#.?.?#..?##.??.#..#.?.##.?.#??.?....#.?#..?#?....#?.?..??.#.??...#.#?.?#.?....#.##.??###.??#?.....?#?..?#..?###...?.?.....##.?#.??..#..#....??.?.##..?..##?...??#..#.?#.#.??##.#.?.#?....###..?#...##..?.?##..#?...

output:

842588007

result:

ok 1 number(s): "842588007"

Test #54:

score: 0
Accepted
time: 12ms
memory: 5140kb

input:

1000
#.????#.###.....##.?.?.?.??#.##?.......#.?.?#??.?#???.??.###.?..????.#..#?.?....#..?#.#.#.#?...?.??...#.#?..###.###??..?#.????##.?#.##???..?.#.?.?###.???..?#?.?.#.?.?#####???.##..#??.#...?.#...#..#.##.?#.?##??.?.?..?.#?.?..#..??....?#?.....##.#..##.#??..?#.....##.#.?#.?#....#..#?...?.#??.#.#..?...

output:

983088081

result:

ok 1 number(s): "983088081"

Test #55:

score: 0
Accepted
time: 8ms
memory: 4536kb

input:

814
..#....#.?..#?.#..##.#..#.##.?##.###..##.#.###.?.?##?..#.#?...?.##..##.?#.....?#.?.??##.#..?.###?..?.??......?#?.#?.#.?.??...##?.#?.###...#...??#..#.?#.?.#..#?...#.?..???###?..#..###...?.#.##.??.##?...#...?#.?....##.#.#.?...#.#.#.#..##??.##..####...?#.?#?.#.##.#.##.?.#.#.#.##..#?.#?.##...#.##.?....

output:

693226393

result:

ok 1 number(s): "693226393"

Test #56:

score: 0
Accepted
time: 12ms
memory: 5168kb

input:

1000
#.#.#.?####..?##??.#.#?...#?.#.#?.?#.#...#.?.??##.#.#.?###?........?##?...#?..#.?#.?.##.#.#.#.?..?###.##.?#.?#..?#.?..?.#?.?##.##.?....#.##?.??..?#.?.?#?..#??.?.#.#.#......###?..#.?#........##.??...?.##..?...??###..?.#.#.#?.?#?.#.#...?#?.##?....##......##??...?.?.??....#..??#...####.?..?##...??...

output:

519222055

result:

ok 1 number(s): "519222055"