QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#210263 | #5089. 环覆盖 | hos_lyric# | 20 | 595ms | 6100kb | C++14 | 6.4kb | 2023-10-11 10:17:06 | 2024-07-04 02:18:46 |
Judging History
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 <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#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; }
#define COLOR(s) ("\x1b[" s "m")
////////////////////////////////////////////////////////////////////////////////
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 = 1000000007;
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;
}
}
}
// divided differences
vector<Mint> interpolateNewton(const vector<Mint> &xs, const vector<Mint> &ys) {
const int n = xs.size();
assert(n == (int)ys.size());
vector<pair<Mint, Mint>> bs(n);
for (int i = 0; i < n; ++i) bs[i] = make_pair(ys[i], 1);
for (int i = 1; i < n; ++i) for (int j = n; --j >= i; ) {
// (as[j] -= as[j - 1]) /= (xs[j] - xs[j - i]);
(bs[j].first *= bs[j - 1].second) -= bs[j - 1].first * bs[j].second;
(bs[j].second *= bs[j - 1].second) *= (xs[j] - xs[j - i]);
}
vector<Mint> as(n);
for (int i = 0; i < n; ++i) as[i] = bs[i].first / bs[i].second;
return as;
}
// \sum[i] as[i] \prod[0<=j<i] (x - xs[j])
Mint evalNewton(const vector<Mint> &xs, const vector<Mint> &as, Mint x) {
const int n = xs.size();
assert(n == (int)as.size());
Mint y = 0;
for (int i = n; --i >= 0; ) (y *= (x - xs[i])) += as[i];
return y;
}
int N, M;
vector<int> A, B;
int main() {
for (; ~scanf("%d%d", &N, &M); ) {
A.resize(M);
B.resize(M);
for (int i = 0; i < M; ++i) {
scanf("%d%d", &A[i], &B[i]);
--A[i];
--B[i];
}
vector<Mint> xs(M + 1), ys(M + 1);
for (int x = 0; x <= M; ++x) {
vector<Mint> fs(1 << N, 1);
for (int i = 0; i < M; ++i) {
for (int p = 0; p < 1 << N; ++p) {
fs[p] *= (1 + (((p >> A[i] & 1) ^ (p >> B[i] & 1)) ? -1 : +1) * x);
}
}
Mint sum = 0;
for (int p = 0; p < 1 << N; ++p) {
sum += fs[p];
}
xs[x] = x;
ys[x] = sum / (1 << N);
}
const auto as = interpolateNewton(xs, ys);
vector<Mint> cs(M+1, 0);
for (int i = M+1; --i >= 0; ) {
for (int j = M+1 - 1 - i; --j >= 0; ) {
cs[j + 1] += cs[j];
cs[j] *= -xs[i];
}
cs[0] += as[i];
}
for (int i = 0; i <= M; ++i) {
if (i) printf(" ");
printf("%u", cs[i].x);
}
puts("");
}
return 0;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 1ms
memory: 3864kb
input:
10 9 3 5 3 10 4 7 4 8 5 6 5 9 6 9 7 9 9 10
output:
1 0 0 1 1 1 0 0 0 0
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
8 15 1 4 1 5 1 8 2 4 2 6 3 6 4 5 4 6 4 7 5 6 5 7 5 8 6 7 6 8 7 8
output:
1 0 0 10 18 26 46 54 43 30 18 8 2 0 0 0
result:
ok 16 numbers
Test #3:
score: 0
Accepted
time: 342ms
memory: 5812kb
input:
19 19 1 12 1 16 1 18 2 8 2 17 3 11 3 17 4 9 4 19 5 17 7 13 8 17 9 13 9 15 9 17 10 16 10 18 14 17 15 16
output:
1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 20 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
7 14 1 3 1 4 1 7 2 3 2 5 2 6 2 7 3 4 3 5 3 7 4 7 5 6 5 7 6 7
output:
1 0 0 11 16 18 46 64 47 30 18 5 0 0 0
result:
ok 15 numbers
Test #5:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
10 9 1 9 2 6 3 5 3 8 3 10 4 6 4 8 5 6 7 10
output:
1 0 0 0 0 1 0 0 0 0
result:
ok 10 numbers
Test #6:
score: 0
Accepted
time: 12ms
memory: 3880kb
input:
15 14 2 9 2 10 3 5 3 10 3 12 3 14 4 6 5 10 5 15 6 9 6 15 7 11 7 13 9 15
output:
1 0 0 2 0 1 3 1 0 0 0 0 0 0 0
result:
ok 15 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
9 8 1 3 2 4 2 7 3 5 3 9 4 6 7 9 8 9
output:
1 0 0 0 0 0 0 0 0
result:
ok 9 numbers
Test #8:
score: 0
Accepted
time: 297ms
memory: 5768kb
input:
19 18 1 5 1 9 1 15 2 4 2 11 2 15 3 6 3 8 3 17 4 19 5 12 6 13 6 15 8 10 8 15 9 19 12 17 13 16
output:
1 0 0 0 1 0 1 2 0 0 1 2 0 0 0 0 0 0 0
result:
ok 19 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
7 18 1 2 1 3 1 4 1 6 1 7 2 3 2 5 2 6 2 7 3 4 3 5 3 7 4 5 4 6 4 7 5 6 5 7 6 7
output:
1 0 0 20 51 108 278 528 711 760 660 468 293 156 54 8 0 0 0
result:
ok 19 numbers
Test #10:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
10 15 1 6 2 4 2 6 2 9 2 10 3 5 3 8 3 9 3 10 4 5 4 8 5 8 5 10 7 9 8 9
output:
1 0 0 4 6 12 16 12 9 4 0 0 0 0 0 0
result:
ok 16 numbers
Subtask #2:
score: 15
Accepted
Dependency #1:
100%
Accepted
Test #11:
score: 15
Accepted
time: 1ms
memory: 3800kb
input:
10 22 1 2 1 3 1 4 1 6 1 8 1 9 2 3 2 4 2 5 2 7 2 8 2 10 3 8 3 10 4 7 4 8 5 7 5 10 6 10 7 9 8 10 9 10
output:
1 0 0 13 33 64 162 367 621 906 1216 1343 1215 988 682 353 146 58 20 4 0 0 0
result:
ok 23 numbers
Test #12:
score: 0
Accepted
time: 5ms
memory: 3724kb
input:
11 38 1 2 1 3 1 4 1 6 1 7 1 8 1 10 2 5 2 8 2 9 2 10 2 11 3 5 3 6 3 7 3 9 3 10 3 11 4 5 4 7 4 11 5 6 5 7 5 9 5 10 5 11 6 7 6 8 6 9 6 10 6 11 7 8 7 9 7 10 8 9 8 11 9 11 10 11
output:
1 0 0 50 210 800 3661 14805 51947 164232 466335 1177265 2639525 5274024 9420013 15077609 21687685 28100640 32827271 34579721 32851761 28140784 21708463 15062239 9394113 5261128 2639589 1183171 472151 166600 51607 13987 3278 656 117 17 1 0 0
result:
ok 39 numbers
Test #13:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
11 24 1 3 1 4 1 7 1 8 2 6 2 7 2 8 3 4 3 5 3 6 3 8 3 10 4 7 4 9 5 7 5 9 5 11 6 8 6 10 6 11 7 10 7 11 8 9 8 10
output:
1 0 0 9 26 65 147 343 709 1179 1783 2437 2715 2489 1993 1341 702 297 109 30 7 2 0 0 0
result:
ok 25 numbers
Test #14:
score: 0
Accepted
time: 3ms
memory: 3856kb
input:
11 37 1 2 1 4 1 5 1 6 1 7 1 10 2 3 2 4 2 6 2 7 2 8 2 9 2 10 3 5 3 6 3 8 3 10 3 11 4 5 4 6 4 9 4 10 4 11 5 7 5 9 6 7 6 8 6 10 6 11 7 9 7 10 7 11 8 9 8 10 8 11 9 10 10 11
output:
1 0 0 46 189 675 2952 11644 39587 121171 335150 825420 1798517 3475223 5977332 9174036 12597741 15530759 17234898 17229504 15512559 12574521 9163776 5982788 3484905 1805833 829874 336708 120415 37965 10436 2476 518 93 14 2 0 0
result:
ok 38 numbers
Test #15:
score: 0
Accepted
time: 517ms
memory: 5844kb
input:
19 24 1 9 1 10 1 17 1 19 2 3 3 6 4 8 4 10 4 13 4 14 5 7 7 11 8 13 8 17 9 12 9 16 10 19 11 15 11 17 12 16 13 15 14 15 14 17 14 19
output:
1 0 0 3 5 8 14 25 31 36 40 33 27 20 10 3 0 0 0 0 0 0 0 0 0
result:
ok 25 numbers
Test #16:
score: 0
Accepted
time: 1ms
memory: 4068kb
input:
9 30 1 3 1 4 1 5 1 6 1 7 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 4 3 5 3 6 3 7 3 8 4 5 4 6 4 8 4 9 5 6 5 7 5 8 5 9 6 7 6 8 6 9 7 9 8 9
output:
1 0 0 48 175 568 2365 8050 22348 54852 117479 214858 338872 467840 567602 604996 567273 467832 338270 213748 117607 55912 22753 7882 2298 548 107 18 2 0 0
result:
ok 31 numbers
Test #17:
score: 0
Accepted
time: 252ms
memory: 5104kb
input:
18 24 1 2 1 7 1 13 1 15 1 17 2 3 2 17 3 9 4 6 4 7 5 8 5 15 5 16 6 7 6 14 7 14 8 11 8 16 10 16 11 12 11 18 14 16 14 17 15 16
output:
1 0 0 5 3 4 14 15 16 21 21 16 8 3 1 0 0 0 0 0 0 0 0 0 0
result:
ok 25 numbers
Test #18:
score: 0
Accepted
time: 7ms
memory: 4088kb
input:
13 27 1 2 1 5 1 7 1 10 1 11 1 12 2 3 2 4 2 12 3 4 3 11 3 12 4 5 4 7 4 12 4 13 5 9 5 10 5 11 7 8 7 9 7 11 7 12 8 11 9 13 10 12 11 13
output:
1 0 0 12 37 85 229 607 1265 2371 4146 6130 7924 9384 9660 8504 6605 4404 2430 1122 423 139 47 9 1 1 0 0
result:
ok 28 numbers
Test #19:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
7 21 1 2 1 3 1 4 1 5 1 6 1 7 2 3 2 4 2 5 2 6 2 7 3 4 3 5 3 6 3 7 4 5 4 6 4 7 5 6 5 7 6 7
output:
1 0 0 35 105 252 805 1935 3255 4515 5481 5481 4515 3255 1935 805 252 105 35 0 0 1
result:
ok 22 numbers
Test #20:
score: 0
Accepted
time: 449ms
memory: 4792kb
input:
18 32 1 4 1 7 1 12 1 16 1 17 1 18 2 3 2 4 2 6 2 8 2 9 2 10 2 17 2 18 3 9 3 15 3 18 4 11 4 12 4 15 4 16 5 17 6 10 6 15 6 17 7 8 9 16 9 18 10 11 11 12 11 16 14 17
output:
1 0 0 10 18 41 122 291 623 1198 2148 3576 5244 6798 8004 8546 8223 7176 5608 3798 2226 1153 498 163 49 18 4 0 0 0 0 0 0
result:
ok 33 numbers
Test #21:
score: 0
Accepted
time: 97ms
memory: 4212kb
input:
17 21 1 5 1 9 1 12 2 3 2 9 2 11 2 12 2 13 2 15 3 13 4 5 4 9 4 11 4 13 5 8 5 15 7 8 7 9 8 10 8 15 12 13
output:
1 0 0 3 6 15 21 32 55 75 87 75 56 45 27 10 2 1 1 0 0 0
result:
ok 22 numbers
Test #22:
score: 0
Accepted
time: 275ms
memory: 4884kb
input:
18 25 1 5 1 6 1 7 1 18 3 4 3 9 3 18 4 9 4 15 5 8 5 10 5 13 5 16 5 17 6 14 6 16 7 8 8 9 9 10 9 14 10 12 10 15 11 12 13 18 16 17
output:
1 0 0 2 5 2 17 21 25 49 57 68 59 68 67 37 22 9 3 0 0 0 0 0 0 0
result:
ok 26 numbers
Test #23:
score: 0
Accepted
time: 4ms
memory: 3776kb
input:
11 31 1 2 1 6 1 7 1 8 1 10 1 11 2 3 2 4 2 7 2 8 3 5 3 6 3 10 3 11 4 5 4 6 4 7 4 8 4 10 5 6 5 8 5 9 5 10 6 10 6 11 7 8 7 10 7 11 8 9 8 11 9 10
output:
1 0 0 25 80 252 931 2947 8105 19882 43247 82492 137162 199904 257302 292622 293531 259948 203238 139705 83764 43252 18951 6991 2155 538 107 18 2 0 0 0
result:
ok 32 numbers
Test #24:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
11 23 1 3 1 6 1 7 1 8 1 10 1 11 2 4 2 7 2 9 2 10 3 4 3 6 3 8 3 9 3 11 4 5 4 6 4 9 5 8 5 10 6 11 8 9 9 11
output:
1 0 0 10 22 49 126 253 455 770 1080 1267 1327 1146 774 475 272 114 36 11 3 1 0 0
result:
ok 24 numbers
Test #25:
score: 0
Accepted
time: 5ms
memory: 3776kb
input:
12 26 1 2 1 4 1 5 1 6 1 8 1 9 1 11 1 12 2 3 2 6 2 8 2 10 2 12 3 10 3 11 3 12 4 6 4 7 4 9 5 9 5 10 6 7 6 8 6 11 7 10 8 9
output:
1 0 0 13 25 58 172 367 751 1471 2425 3509 4595 5207 4957 3973 2676 1501 699 266 80 19 3 0 0 0 0
result:
ok 27 numbers
Test #26:
score: 0
Accepted
time: 71ms
memory: 3896kb
input:
15 36 1 3 1 6 2 5 2 11 2 14 2 15 3 6 3 7 3 9 3 11 3 12 3 13 4 10 4 11 4 14 5 6 5 9 5 10 5 11 5 12 5 15 6 13 6 14 7 8 7 12 7 13 7 15 8 9 8 13 8 14 10 14 11 13 12 13 12 14 12 15 13 14
output:
1 0 0 16 47 142 453 1358 3739 9187 20868 43655 82997 144331 229041 329775 431023 509806 542672 519878 448465 346692 239031 146924 80469 38975 16428 5939 1835 467 83 7 0 0 0 0 0
result:
ok 37 numbers
Test #27:
score: 0
Accepted
time: 348ms
memory: 4580kb
input:
17 40 1 3 1 5 1 6 1 8 2 3 2 7 2 8 2 9 2 17 3 5 3 7 3 8 3 9 3 11 4 5 4 7 4 10 4 12 5 6 5 8 5 15 6 12 6 13 6 15 6 17 7 15 8 11 8 14 8 16 9 12 9 13 9 14 9 16 10 11 10 16 11 12 11 16 11 17 12 14 12 17
output:
1 0 0 15 35 114 403 1162 3281 8752 21580 49554 105445 207380 375007 621544 945721 1318606 1677800 1947770 2063989 1989450 1738049 1375770 984863 634460 367508 191810 89635 37264 13901 4628 1334 326 56 3 0 0 0 0 0
result:
ok 41 numbers
Test #28:
score: 0
Accepted
time: 438ms
memory: 6100kb
input:
19 22 1 8 1 17 2 7 2 13 3 6 3 8 3 9 3 17 4 8 5 10 5 12 5 17 6 9 7 10 8 11 9 11 9 13 10 16 11 12 11 15 12 17 15 19
output:
1 0 0 2 2 4 6 6 7 7 7 7 5 5 3 1 1 0 0 0 0 0 0
result:
ok 23 numbers
Test #29:
score: 0
Accepted
time: 595ms
memory: 5044kb
input:
18 37 1 3 1 12 2 14 3 4 3 8 3 11 3 14 3 16 4 12 5 6 5 7 5 17 6 7 6 8 6 12 6 14 6 18 7 8 7 9 7 12 7 14 8 15 8 18 9 13 9 18 10 12 10 15 11 17 12 13 12 14 13 14 13 16 13 18 14 17 15 16 16 18 17 18
output:
1 0 0 10 33 82 233 654 1551 3511 7445 14215 25024 40511 60096 82061 102886 118406 124842 120512 106865 86464 63433 42184 24919 12915 6033 2495 862 255 62 13 3 0 0 0 0 0
result:
ok 38 numbers
Test #30:
score: 0
Accepted
time: 55ms
memory: 3976kb
input:
16 22 1 4 1 7 1 13 1 14 2 4 2 11 3 6 3 8 3 9 4 7 4 8 4 14 5 14 6 13 8 11 8 15 10 16 12 14 12 15 13 15 14 16 15 16
output:
1 0 0 2 3 6 7 13 18 15 14 14 15 10 3 3 3 1 0 0 0 0 0
result:
ok 23 numbers
Subtask #3:
score: 0
Time Limit Exceeded
Test #31:
score: 0
Time Limit Exceeded
input:
25 45 1 6 1 12 1 17 2 3 2 4 2 6 3 6 3 8 4 5 4 12 4 16 5 17 6 21 7 14 7 22 7 23 8 15 8 19 8 24 9 11 9 19 9 23 9 25 10 17 10 18 11 16 11 19 11 22 12 19 13 18 14 19 15 19 16 24 17 19 17 22 17 25 18 19 18 21 18 24 19 23 20 22 21 25 22 23 23 25 24 25
output:
result:
Subtask #4:
score: 0
Time Limit Exceeded
Dependency #2:
100%
Accepted
Test #51:
score: 30
Accepted
time: 593ms
memory: 3848kb
input:
15 104 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 6 7 6 8 6 9 6 10 6 11 6...
output:
1 0 0 442 3939 34320 372801 3661658 32985238 283075936 294329881 441417693 293007257 733544953 819572609 817295250 950834455 866813935 477236103 827061189 801102395 532780660 971544264 254912703 380778104 572112036 447607103 447536960 848347203 364310032 327003537 595530991 844889153 408801661 53864...
result:
ok 105 numbers
Test #52:
score: 0
Accepted
time: 8ms
memory: 3796kb
input:
11 48 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 3 4 3 5 3 6 3 8 3 9 3 10 4 5 4 6 4 7 4 8 4 9 4 10 4 11 5 6 5 10 5 11 6 7 6 8 6 9 6 10 7 8 7 9 7 10 7 11 8 10 8 11 9 10 9 11 10 11
output:
1 0 0 109 570 2747 16659 87743 401245 1683808 6425588 22009859 67734240 187875613 470651385 67923054 203081700 146567060 139877519 271028373 340736780 787638539 741967528 233415764 495334841 235657822 745096210 789747251 340760696 269512157 138207585 145638206 202922879 68222601 471116512 188240033 ...
result:
ok 49 numbers
Test #53:
score: 0
Accepted
time: 10ms
memory: 3792kb
input:
11 53 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 11 3 4 3 5 3 6 3 7 3 8 3 10 3 11 4 5 4 6 4 7 4 8 4 9 4 10 4 11 5 6 5 7 5 8 5 9 5 10 5 11 6 7 6 8 6 9 6 10 6 11 7 8 7 9 7 10 7 11 8 9 8 10 8 11 9 10 9 11 10 11
output:
1 0 0 147 848 4564 31031 182864 939323 4444237 19156298 74280489 259536298 819829262 346508993 105489604 501641494 558922700 108877499 237906596 592349717 510284806 680501081 816312648 29051039 775037180 645253810 617231424 715537662 984053436 811352758 709885471 547377455 610458255 232561172 951544...
result:
ok 54 numbers
Test #54:
score: -30
Time Limit Exceeded
input:
17 95 1 4 1 6 1 7 1 8 1 9 1 11 1 12 1 13 1 14 1 16 1 17 2 3 2 4 2 5 2 6 2 7 2 9 2 10 2 11 2 13 2 14 2 15 2 16 3 4 3 5 3 6 3 7 3 8 3 9 3 11 3 13 3 14 3 15 3 17 4 5 4 7 4 9 4 11 4 12 4 13 4 14 4 16 5 6 5 7 5 8 5 9 5 11 5 13 5 15 5 16 6 7 6 8 6 9 6 10 6 12 6 13 6 14 6 15 6 16 6 17 7 9 7 11 7 12 7 13 7 ...
output:
result:
Subtask #5:
score: 0
Skipped
Dependency #4:
0%