QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#119169#5524. Help Me to Get This Publishedhos_lyricAC ✓20ms8936kbC++145.4kb2023-07-05 02:25:192023-07-05 02:25:50

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-05 02:25:50]
  • 评测
  • 测评结果:AC
  • 用时:20ms
  • 内存:8936kb
  • [2023-07-05 02:25:19]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }

////////////////////////////////////////////////////////////////////////////////
template <unsigned M_> struct ModInt {
  static constexpr unsigned M = M_;
  unsigned x;
  constexpr ModInt() : x(0U) {}
  constexpr ModInt(unsigned x_) : x(x_ % M) {}
  constexpr ModInt(unsigned long long x_) : x(x_ % M) {}
  constexpr ModInt(int x_) : x(((x_ %= static_cast<int>(M)) < 0) ? (x_ + static_cast<int>(M)) : x_) {}
  constexpr ModInt(long long x_) : x(((x_ %= static_cast<long long>(M)) < 0) ? (x_ + static_cast<long long>(M)) : x_) {}
  ModInt &operator+=(const ModInt &a) { x = ((x += a.x) >= M) ? (x - M) : x; return *this; }
  ModInt &operator-=(const ModInt &a) { x = ((x -= a.x) >= M) ? (x + M) : x; return *this; }
  ModInt &operator*=(const ModInt &a) { x = (static_cast<unsigned long long>(x) * a.x) % M; return *this; }
  ModInt &operator/=(const ModInt &a) { return (*this *= a.inv()); }
  ModInt pow(long long e) const {
    if (e < 0) return inv().pow(-e);
    ModInt a = *this, b = 1U; for (; e; e >>= 1) { if (e & 1) b *= a; a *= a; } return b;
  }
  ModInt inv() const {
    unsigned a = M, b = x; int y = 0, z = 1;
    for (; b; ) { const unsigned q = a / b; const unsigned c = a - q * b; a = b; b = c; const int w = y - static_cast<int>(q) * z; y = z; z = w; }
    assert(a == 1U); return ModInt(y);
  }
  ModInt operator+() const { return *this; }
  ModInt operator-() const { ModInt a; a.x = x ? (M - x) : 0U; return a; }
  ModInt operator+(const ModInt &a) const { return (ModInt(*this) += a); }
  ModInt operator-(const ModInt &a) const { return (ModInt(*this) -= a); }
  ModInt operator*(const ModInt &a) const { return (ModInt(*this) *= a); }
  ModInt operator/(const ModInt &a) const { return (ModInt(*this) /= a); }
  template <class T> friend ModInt operator+(T a, const ModInt &b) { return (ModInt(a) += b); }
  template <class T> friend ModInt operator-(T a, const ModInt &b) { return (ModInt(a) -= b); }
  template <class T> friend ModInt operator*(T a, const ModInt &b) { return (ModInt(a) *= b); }
  template <class T> friend ModInt operator/(T a, const ModInt &b) { return (ModInt(a) /= b); }
  explicit operator bool() const { return x; }
  bool operator==(const ModInt &a) const { return (x == a.x); }
  bool operator!=(const ModInt &a) const { return (x != a.x); }
  friend std::ostream &operator<<(std::ostream &os, const ModInt &a) { return os << a.x; }
};
////////////////////////////////////////////////////////////////////////////////

constexpr unsigned MO = 998244353;
using Mint = ModInt<MO>;

constexpr int LIM_INV = 1010;
Mint inv[LIM_INV], fac[LIM_INV], invFac[LIM_INV];

void prepare() {
  inv[1] = 1;
  for (int i = 2; i < LIM_INV; ++i) {
    inv[i] = -((Mint::M / i) * inv[Mint::M % i]);
  }
  fac[0] = invFac[0] = 1;
  for (int i = 1; i < LIM_INV; ++i) {
    fac[i] = fac[i - 1] * i;
    invFac[i] = invFac[i - 1] * inv[i];
  }
}
Mint binom(Int n, Int k) {
  if (n < 0) {
    if (k >= 0) {
      return ((k & 1) ? -1 : +1) * binom(-n + k - 1, k);
    } else if (n - k >= 0) {
      return (((n - k) & 1) ? -1 : +1) * binom(-k - 1, n - k);
    } else {
      return 0;
    }
  } else {
    if (0 <= k && k <= n) {
      assert(n < LIM_INV);
      return fac[n] * invFac[k] * invFac[n - k];
    } else {
      return 0;
    }
  }
}


// d -> d,d  or  d -> d+1,d+1

int N;
vector<int> A;

// d, lot, state
Mint dp[110][110][110];

int main() {
  prepare();
  
  for (; ~scanf("%d", &N); ) {
    A.resize(N);
    for (int i = 0; i < N; ++i) {
      scanf("%d", &A[i]);
    }
    
    vector<int> freq(N, 0);
    int lot = 0;
    for (int i = 0; i < N; ++i) {
      if (~A[i]) {
        ++freq[A[i]];
      } else {
        ++lot;
      }
    }
    
    memset(dp, 0, sizeof(dp));
    dp[N - 1][lot][0] = 1;
    for (int d = N - 1; d >= 1; --d) {
      for (int l = 0; l <= lot; ++l) for (int u = 0; u <= N; ++u) if (dp[d][l][u]) {
        for (int x = 0; x <= l; ++x) {
          int v = u + (freq[d] + x);
          if (v != 1) {
            v /= 2;
            dp[d - 1][l - x][v] += dp[d][l][u] * invFac[x];
          }
        }
      }
    }
    Mint ans = 0;
    for (int u = 1; u <= N; ++u) {
      ans += dp[0][0][u];
    }
    ans *= fac[lot];
    printf("%u\n", ans.x);
  }
  return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 8772kb

input:

2
1 -1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

3
-1 -1 -1

output:

4

result:

ok 1 number(s): "4"

Test #3:

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

input:

6
5 -1 -1 -1 -1 -1

output:

120

result:

ok 1 number(s): "120"

Test #4:

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

input:

4
-1 -1 -1 -1

output:

24

result:

ok 1 number(s): "24"

Test #5:

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

input:

5
-1 -1 -1 -1 -1

output:

182

result:

ok 1 number(s): "182"

Test #6:

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

input:

6
-1 -1 -1 -1 -1 -1

output:

1659

result:

ok 1 number(s): "1659"

Test #7:

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

input:

7
-1 -1 -1 -1 -1 -1 -1

output:

17677

result:

ok 1 number(s): "17677"

Test #8:

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

input:

8
-1 -1 -1 -1 -1 -1 -1 -1

output:

215403

result:

ok 1 number(s): "215403"

Test #9:

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

input:

9
-1 -1 -1 -1 -1 -1 -1 -1 -1

output:

2953953

result:

ok 1 number(s): "2953953"

Test #10:

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

input:

10
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

45017641

result:

ok 1 number(s): "45017641"

Test #11:

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

input:

11
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

754725282

result:

ok 1 number(s): "754725282"

Test #12:

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

input:

12
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

826640071

result:

ok 1 number(s): "826640071"

Test #13:

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

input:

13
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

993120404

result:

ok 1 number(s): "993120404"

Test #14:

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

input:

14
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

698356428

result:

ok 1 number(s): "698356428"

Test #15:

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

input:

15
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

118946018

result:

ok 1 number(s): "118946018"

Test #16:

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

input:

50
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

564173612

result:

ok 1 number(s): "564173612"

Test #17:

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

input:

51
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

350683684

result:

ok 1 number(s): "350683684"

Test #18:

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

input:

52
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

395178587

result:

ok 1 number(s): "395178587"

Test #19:

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

input:

53
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

656031164

result:

ok 1 number(s): "656031164"

Test #20:

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

input:

54
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

785223177

result:

ok 1 number(s): "785223177"

Test #21:

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

input:

55
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

926194639

result:

ok 1 number(s): "926194639"

Test #22:

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

input:

95
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

570944557

result:

ok 1 number(s): "570944557"

Test #23:

score: 0
Accepted
time: 14ms
memory: 8844kb

input:

96
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

419636252

result:

ok 1 number(s): "419636252"

Test #24:

score: 0
Accepted
time: 19ms
memory: 8936kb

input:

97
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

688753783

result:

ok 1 number(s): "688753783"

Test #25:

score: 0
Accepted
time: 20ms
memory: 8780kb

input:

98
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

984213479

result:

ok 1 number(s): "984213479"

Test #26:

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

input:

99
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

965943140

result:

ok 1 number(s): "965943140"

Test #27:

score: 0
Accepted
time: 14ms
memory: 8888kb

input:

100
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

827279277

result:

ok 1 number(s): "827279277"

Test #28:

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

input:

4
1 -1 -1 -1

output:

8

result:

ok 1 number(s): "8"

Test #29:

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

input:

5
-1 -1 -1 3 -1

output:

56

result:

ok 1 number(s): "56"

Test #30:

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

input:

6
-1 -1 -1 -1 1 3

output:

107

result:

ok 1 number(s): "107"

Test #31:

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

input:

7
-1 -1 -1 -1 4 4 -1

output:

710

result:

ok 1 number(s): "710"

Test #32:

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

input:

8
-1 -1 6 -1 -1 -1 -1 -1

output:

21840

result:

ok 1 number(s): "21840"

Test #33:

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

input:

9
7 6 -1 -1 -1 -1 -1 -1 -1

output:

28560

result:

ok 1 number(s): "28560"

Test #34:

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

input:

10
9 9 -1 -1 -1 -1 8 -1 -1 -1

output:

5040

result:

ok 1 number(s): "5040"

Test #35:

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

input:

11
-1 5 -1 -1 -1 -1 -1 10 6 -1 -1

output:

40320

result:

ok 1 number(s): "40320"

Test #36:

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

input:

12
-1 -1 -1 -1 -1 -1 7 -1 -1 -1 -1 -1

output:

664376167

result:

ok 1 number(s): "664376167"

Test #37:

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

input:

13
-1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 -1

output:

676749930

result:

ok 1 number(s): "676749930"

Test #38:

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

input:

14
-1 -1 -1 -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1

output:

237554682

result:

ok 1 number(s): "237554682"

Test #39:

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

input:

15
-1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

287491169

result:

ok 1 number(s): "287491169"

Test #40:

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

input:

16
-1 9 -1 -1 2 -1 4 7 -1 2 -1 -1 -1 -1 5 -1

output:

215687894

result:

ok 1 number(s): "215687894"

Test #41:

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

input:

17
-1 -1 16 -1 -1 -1 -1 -1 -1 10 -1 -1 15 -1 -1 10 -1

output:

0

result:

ok 1 number(s): "0"

Test #42:

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

input:

18
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 16

output:

865644974

result:

ok 1 number(s): "865644974"

Test #43:

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

input:

19
-1 -1 -1 -1 15 -1 -1 -1 -1 10 16 5 16 -1 -1 -1 -1 -1 -1

output:

660385899

result:

ok 1 number(s): "660385899"

Test #44:

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

input:

20
-1 -1 -1 -1 -1 -1 -1 -1 -1 19 -1 -1 -1 17 -1 -1 -1 -1 -1 18

output:

986189864

result:

ok 1 number(s): "986189864"

Test #45:

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

input:

50
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 41 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

504758213

result:

ok 1 number(s): "504758213"

Test #46:

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

input:

51
-1 -1 -1 39 -1 -1 -1 -1 -1 -1 -1 9 -1 -1 24 -1 -1 -1 31 -1 -1 -1 -1 -1 39 -1 -1 -1 -1 38 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 13 35 -1 -1

output:

954222280

result:

ok 1 number(s): "954222280"

Test #47:

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

input:

52
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 16 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

230073768

result:

ok 1 number(s): "230073768"

Test #48:

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

input:

53
-1 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 -1 -1 -1 2 -1 -1 16 -1 -1 -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 44 -1 -1 -1 -1 -1 -1 -1 -1 8 -1 -1 -1

output:

984713408

result:

ok 1 number(s): "984713408"

Test #49:

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

input:

54
-1 -1 -1 -1 -1 -1 42 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 34 -1 -1 49 -1 -1 -1 5 -1 -1 -1 -1 -1 -1 -1 32 -1 -1 -1 -1 32 -1 -1 33 -1 -1 -1 -1 -1 39 -1 19

output:

403663226

result:

ok 1 number(s): "403663226"

Test #50:

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

input:

55
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 36 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 -1

output:

909570793

result:

ok 1 number(s): "909570793"

Test #51:

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

input:

56
-1 -1 -1 -1 17 -1 38 7 33 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 53 -1 -1 -1 -1 -1 -1 25 -1 -1 -1 12 -1 -1 -1 -1 49 -1 -1 5 37 50 -1 -1 -1 -1 -1 -1 -1 -1 -1 8

output:

511528802

result:

ok 1 number(s): "511528802"

Test #52:

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

input:

57
-1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 29 -1 -1 -1 46 -1 -1 -1 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 32 -1

output:

265052053

result:

ok 1 number(s): "265052053"

Test #53:

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

input:

58
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 56 -1 -1 -1 -1 -1 14 -1 28 -1 -1 -1 -1 -1 24 -1 -1 -1 -1 -1 -1 40 -1 -1 -1 -1 -1 -1 47 -1 -1 -1 -1 15 42 -1 -1 48 -1 46

output:

242541296

result:

ok 1 number(s): "242541296"

Test #54:

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

input:

59
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1

output:

963693732

result:

ok 1 number(s): "963693732"

Test #55:

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

input:

60
-1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

988086832

result:

ok 1 number(s): "988086832"

Test #56:

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

input:

90
76 1 10 -1 -1 -1 -1 -1 76 -1 -1 -1 25 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 -1 -1 -1 36 -1 -1 -1 10 -1 88 -1 -1 -1 -1 -1 16 -1 33 64 -1 -1 -1 -1 40 -1 88 -1 -1 -1 -1 54 74 -1 31 -1 -1 -1 -1 89 64 -1 -1 28 39 60 -1 -1 85 -1 33 65 -1 -1 -1 -1 -1 24 9 16 -1

output:

0

result:

ok 1 number(s): "0"

Test #57:

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

input:

91
-1 -1 -1 -1 51 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 22 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 24 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

947283398

result:

ok 1 number(s): "947283398"

Test #58:

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

input:

92
-1 -1 27 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 56 -1 -1 -1 -1 -1 -1 -1 -1 78 -1 -1 -1 -1 -1 -1 -1 44 -1 -1 -1 -1 -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 33 -1 -1 -1 -1

output:

416825745

result:

ok 1 number(s): "416825745"

Test #59:

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

input:

93
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

630139005

result:

ok 1 number(s): "630139005"

Test #60:

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

input:

94
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 34 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 79 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 50 -1

output:

391935573

result:

ok 1 number(s): "391935573"

Test #61:

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

input:

95
-1 -1 -1 93 -1 -1 72 -1 9 -1 -1 -1 83 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 8 -1 -1 -1 -1 -1 -1 -1 61 -1 38 22 -1 -1 -1 -1 8 1 39 -1 -1 32 5 -1 -1 -1 60 -1 -1 91 9 -1 67 -1 -1 -1 38 -1 27 -1 -1 -1 -1 -1 -1 -1 76 -1 -1 -1 -1 6 -1 53 10 -1 -1 18 -1 -1 -1 -1 -1 -1 -1 20 46 -1 -1 89 -1

output:

0

result:

ok 1 number(s): "0"

Test #62:

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

input:

96
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

236292818

result:

ok 1 number(s): "236292818"

Test #63:

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

input:

97
-1 -1 50 -1 -1 16 76 96 -1 91 -1 -1 -1 87 -1 -1 26 -1 -1 -1 -1 -1 -1 -1 14 -1 96 -1 -1 41 69 51 49 62 47 -1 -1 -1 86 -1 -1 -1 -1 -1 -1 -1 -1 -1 36 12 -1 1 42 -1 4 -1 -1 67 -1 -1 -1 29 -1 -1 -1 -1 7 88 -1 5 50 94 78 -1 -1 45 -1 -1 34 -1 -1 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 -1 -1 61 -1 10 60

output:

0

result:

ok 1 number(s): "0"

Test #64:

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

input:

98
-1 -1 -1 24 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

output:

144248017

result:

ok 1 number(s): "144248017"

Test #65:

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

input:

99
-1 -1 -1 -1 -1 -1 59 -1 -1 -1 -1 -1 -1 -1 39 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 20 -1 -1 -1 -1 -1 -1 95 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 37 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 86 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 91

output:

514106600

result:

ok 1 number(s): "514106600"

Test #66:

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

input:

100
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 12 71 46 -1 -1 -1 -1 -1 22 84 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 34 -1 -1 54 -1 -1 -1 -1 -1 -1 -1 28 -1 -1 -1 -1 87 -1 14 -1 -1 -1 -1 64 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 75 -1 -1 13 -1 -1 -1...

output:

882855750

result:

ok 1 number(s): "882855750"