QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#331027 | #8226. 堆操作练习题2 | Licykoc | 100 ✓ | 1825ms | 38820kb | C++20 | 6.6kb | 2024-02-17 22:39:15 | 2024-05-22 20:43:08 |
Judging History
answer
#include <bits/stdc++.h>
template<unsigned P>
class modint {
static_assert(1 <= P, "P must be a positive integer");
using mint = modint<P>;
protected:
unsigned v;
public:
constexpr modint() : v() {}
template<typename T,
typename std::enable_if<std::is_integral<T>::value &&
std::is_signed<T>::value,
bool>::type = true>
constexpr modint(T t_v) : v() {
long long tmp = t_v % static_cast<long long>(P);
if (tmp < 0) {
tmp += P;
}
v = tmp;
}
template<typename T,
typename std::enable_if<std::is_integral<T>::value &&
std::is_unsigned<T>::value,
bool>::type = true>
constexpr modint(T t_v) : v() {
v = t_v % P;
}
constexpr unsigned val() const {
return v;
}
static constexpr unsigned mod() {
return P;
}
static constexpr mint raw(unsigned v) {
mint res;
res.v = v;
return res;
}
constexpr mint &operator+=(const mint &rhs) {
v < P - rhs.v ? v += rhs.v : v -= P - rhs.v;
return *this;
}
constexpr mint &operator++() {
v + 1 < P ? ++v : v = 0;
return *this;
}
constexpr mint operator++(int) {
mint tmp = *this;
v + 1 < P ? ++v : v = 0;
return tmp;
}
constexpr mint &operator-=(const mint &rhs) {
v < rhs.v ? v += P - rhs.v : v -= rhs.v;
return *this;
}
constexpr mint &operator--() {
v ? --v : v = P - 1;
return *this;
}
constexpr mint operator--(int) {
mint tmp = *this;
v ? --v : v = P - 1;
return tmp;
}
constexpr mint operator-() const {
mint res;
res.v = v ? P - v : 0;
return res;
}
constexpr mint &operator*=(const mint &rhs) {
v = static_cast<unsigned long long>(v) * rhs.v % P;
return *this;
}
constexpr mint pow(unsigned long long b) const {
mint a(*this), s(1);
for (; b; b >>= 1) {
if (b & 1) {
s *= a;
}
a *= a;
}
return s;
}
constexpr mint inv() const {
return pow(P - 2);
}
constexpr friend mint operator+(const mint &lhs, const mint &rhs) {
return mint(lhs) += rhs;
}
constexpr friend mint operator-(const mint &lhs, const mint &rhs) {
return mint(lhs) -= rhs;
}
constexpr friend mint operator*(const mint &lhs, const mint &rhs) {
return mint(lhs) *= rhs;
}
constexpr friend bool operator==(const mint &lhs, const mint &rhs) {
return lhs.v == rhs.v;
}
constexpr friend bool operator!=(const mint &lhs, const mint &rhs) {
return lhs.v != rhs.v;
}
friend std::istream &operator>>(std::istream &in, mint &x) {
return in >> x.v;
}
friend std::ostream &operator<<(std::ostream &out, const mint &x) {
return out << x.v;
}
};
using mint = modint<1000000007>;
template<class Tp>
class Fenwick {
private:
int n;
std::vector<Tp> tree;
public:
Fenwick(int n) : n(n), tree(n + 1) {}
void add(int x, Tp y) {
++x;
for (; x <= n; x += x & -x) {
tree[x] += y;
}
}
Tp query(int x) {
++x;
Tp res{};
for (; x; x -= x & -x) {
res += tree[x];
}
return res;
}
Tp query(int x, int y) {
return query(y) - query(x - 1);
}
};
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int h, n;
std::cin >> h;
n = 1 << h;
std::vector<int> a(n);
for (int i = 1; i < n; ++i) {
std::cin >> a[i];
}
int q;
std::cin >> q;
std::vector<std::tuple<int, int, int>> opt(q);
std::vector<std::vector<int>> opts(n);
std::vector<int> size(q);
int sum = 0;
for (int i = 0; i < q; ++i) {
auto &[op, x, y] = opt[i];
std::cin >> op >> x >> y;
if (op <= 2 && y == 2) {
sum += op == 1 ? 1 : -1;
}
size[i] = sum;
opts[x].emplace_back(i);
}
Fenwick<int> ds(1000001);
std::vector<int> b(n), f(n);
std::vector<std::pair<int, mint>> ans;
for (int root = 1; root < n; ++root) {
std::vector<int> S;
auto dfs = [&](auto &self, int p) {
if (p >= n) {
return;
}
for (auto id : opts[p]) {
S.emplace_back(id);
}
b[p] = a[p];
self(self, 2 * p);
self(self, 2 * p + 1);
};
dfs(dfs, root);
std::sort(S.begin(), S.end());
auto update = [&](int mode) {
int x = root;
if (!b[x]) {
return 0;
}
if (mode == 1) {
b[x] = 0;
}
while (2 * x + 1 < n) {
if (!b[2 * x] && !b[2 * x + 1]) {
break;
}
if (b[2 * x] < b[2 * x + 1]) {
if (mode == 1) {
std::swap(b[x], b[2 * x + 1]);
}
x = 2 * x + 1;
} else {
if (mode == 1) {
std::swap(b[x], b[2 * x]);
}
x = 2 * x;
}
}
return x;
};
int x = update(0);
while (x) {
f[x] = b[root];
update(1);
x = update(0);
}
std::multiset<int> max;
for (auto id : S) {
auto [op, x, y] = opt[id];
if (op == 1) {
if (y == 1) {
max.insert(f[x]);
} else {
ds.add(f[x], 1);
}
}
if (op == 2) {
if (y == 1) {
max.erase(max.find(f[x]));
} else {
ds.add(f[x], -1);
}
}
if (op == 3) {
if (x != root) {
continue;
}
int nmax = max.empty() ? 0 : *max.rbegin();
mint res = 1;
if (nmax > y) {
res = 0;
} else {
if (nmax == y) {
res = mint(2).pow(ds.query(y));
} else {
res = mint(2).pow(ds.query(y - 1)) * (mint(2).pow(ds.query(y, y)) - 1);
}
}
ans.emplace_back(id, res * mint(2).pow(size[id] - ds.query(1000000)));
}
}
for (auto id : S) {
auto [op, x, y] = opt[id];
if (op == 1 && y == 2) {
ds.add(f[x], -1);
}
if (op == 2 && y == 2) {
ds.add(f[x], 1);
}
}
}
std::sort(ans.begin(), ans.end(), [&](const auto &x, const auto &y) {
return x.first < y.first;
});
for (auto [_, x] : ans) {
std::cout << x << '\n';
}
}
这程序好像有点Bug,我给组数据试试?
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 2ms
memory: 7044kb
input:
2 3 2 1 50 3 3 1 1 1 2 1 2 1 2 2 1 1 2 2 2 1 2 1 1 1 1 3 2 2 1 1 2 2 2 3 1 2 3 1 3 2 3 2 1 3 2 1 2 2 2 2 2 1 2 1 1 1 2 3 1 1 2 1 2 1 1 1 2 1 1 3 1 2 3 1 3 2 3 2 1 3 2 2 2 1 1 2 1 1 1 1 3 1 2 2 1 1 1 1 1 3 3 1 2 1 1 2 3 2 1 3 1 2 3 1 1 1 2 3 1 3 2 1 2 3 3 1 3 1 3 3 1 1 3 1 1 1 3 2 1 1 1 2 1 1 3 1 1 2...
output:
0 1 0 0 0 2 0 1 2 0 1 0 0 0 0
result:
ok 15 numbers
Test #2:
score: 10
Accepted
time: 2ms
memory: 6916kb
input:
2 3 1 2 50 1 2 2 3 3 2 2 2 2 1 3 1 1 1 1 3 3 2 2 1 1 3 1 3 2 3 1 1 3 1 1 1 1 1 2 2 2 1 1 3 1 3 2 3 1 2 2 2 1 1 2 1 2 1 1 3 1 2 1 2 3 3 2 1 1 1 2 3 1 1 3 2 2 3 2 1 3 1 2 2 1 3 3 2 3 1 1 2 3 1 2 1 1 1 3 1 2 3 1 3 1 3 3 1 3 3 1 3 1 1 1 2 1 1 3 1 2 1 2 1 3 1 1 3 3 2 3 1 3 2 2 1 1 1 1 2 1 1 1 2 1 1 1 2 2...
output:
0 1 1 2 1 1 0 0 0 0 0 0 0 0 0
result:
ok 15 numbers
Subtask #2:
score: 10
Accepted
Dependency #1:
100%
Accepted
Test #3:
score: 10
Accepted
time: 0ms
memory: 6984kb
input:
4 15 14 13 9 10 11 12 2 7 4 5 1 6 8 3 500 3 1 15 3 1 13 1 9 1 1 6 2 1 15 2 1 14 1 1 10 2 1 5 2 3 12 1 1 1 1 1 4 1 3 6 6 3 10 4 1 3 1 3 13 6 1 11 2 2 4 1 2 14 1 3 6 6 3 1 11 3 1 14 3 2 4 2 6 2 2 15 2 3 1 9 3 7 12 1 13 2 2 9 1 2 5 2 3 14 8 1 15 2 1 12 1 3 11 5 1 5 2 3 1 15 3 5 10 3 1 11 1 14 1 2 13 2 ...
output:
0 0 0 0 8 0 0 8 0 0 0 0 0 8 16 16 0 0 0 32 0 0 32 16 0 0 16 0 0 0 0 4 0 0 0 0 8 0 0 0 0 0 64 64 0 128 0 0 0 128 64 256 0 64 64 0 0 0 8 4 2 0 2 0 0 0 0 8 4 16 0 0 2 0 2 8 0 0 16 0 8 0 0 16 32 0 32 0 4 4 0 4 0 0 0 0 4 0 0 0 2 0 0 0 0 0 4 2 0 0 0 16 8 0 0 0 0 8 2 4 0 4 4 4 16 0 8 8 16 16 0 0 8 0 0 0 0 ...
result:
ok 171 numbers
Test #4:
score: 10
Accepted
time: 2ms
memory: 7048kb
input:
4 15 13 14 7 12 8 11 3 4 9 2 5 6 1 10 500 1 2 1 1 14 2 1 4 1 3 1 12 1 15 2 3 1 15 1 9 2 2 4 1 1 13 1 3 7 1 2 13 1 2 15 2 1 7 2 1 13 1 3 15 10 2 2 1 3 2 2 1 2 2 2 2 2 1 15 2 1 11 1 2 9 2 3 3 11 1 1 1 1 12 2 3 10 9 3 4 3 3 7 1 2 7 2 1 4 1 1 5 1 2 15 2 2 12 2 1 10 2 3 2 7 3 2 13 1 3 1 3 1 15 2 1 1 3 14...
output:
1 2 0 0 0 2 0 0 2 0 2 0 2 0 8 4 0 0 8 4 0 4 4 4 1 0 0 4 0 0 8 0 0 0 32 128 0 0 0 16 0 16 0 0 0 0 8 0 0 0 0 0 16 0 32 0 0 0 8 4 0 0 4 0 0 0 0 0 8 8 0 8 0 0 0 8 0 0 16 0 0 0 0 0 0 2 0 2 0 0 2 0 0 2 1 0 0 0 0 8 16 16 0 0 0 0 0 0 0 0 0 0 0 16 0 0 16 32 0 0 16 0 32 0 0 64 0 4 0 8 0 0 0 4 1 0 0 16 4 0 0 0...
result:
ok 148 numbers
Subtask #3:
score: 20
Accepted
Test #5:
score: 20
Accepted
time: 6ms
memory: 7160kb
input:
9 511 509 510 504 507 505 508 501 503 506 502 494 500 499 493 473 483 495 475 491 497 461 487 490 489 498 496 478 485 480 488 378 469 482 477 462 448 422 470 424 467 421 492 439 454 484 451 376 385 458 464 463 486 411 472 449 474 459 468 479 413 457 455 371 315 432 437 466 453 476 418 433 363 434 38...
output:
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 1 1 ...
result:
ok 1644 numbers
Test #6:
score: 20
Accepted
time: 3ms
memory: 7244kb
input:
9 511 510 506 509 508 505 504 500 507 501 503 497 498 502 484 454 495 485 494 488 496 493 474 491 460 487 490 486 499 468 467 408 448 451 469 479 478 412 492 482 476 440 466 489 411 462 470 384 407 438 452 430 464 439 481 456 483 449 422 420 446 441 370 372 376 404 443 369 417 405 416 465 444 275 45...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 ...
result:
ok 1657 numbers
Test #7:
score: 20
Accepted
time: 3ms
memory: 7232kb
input:
9 511 508 510 502 505 506 509 497 489 501 504 496 500 507 499 494 486 466 482 472 442 503 453 492 469 481 477 488 491 483 484 493 416 480 485 420 465 436 471 353 447 437 384 490 498 399 381 487 468 461 457 478 479 474 473 248 430 412 448 429 421 449 475 423 476 338 410 435 444 438 462 379 415 372 39...
output:
0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 1 0 1 1 1 0 0 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 ...
result:
ok 1644 numbers
Test #8:
score: 20
Accepted
time: 6ms
memory: 7244kb
input:
9 511 509 510 505 506 508 490 499 484 497 501 507 504 477 481 494 469 479 468 458 486 496 487 503 495 498 449 461 467 476 480 448 470 424 459 413 478 441 466 429 446 485 438 489 463 473 483 502 500 491 492 474 493 443 430 385 433 453 447 460 472 379 408 363 415 367 445 401 405 426 259 383 351 322 45...
output:
0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 ...
result:
ok 1620 numbers
Subtask #4:
score: 20
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #9:
score: 20
Accepted
time: 3ms
memory: 7232kb
input:
9 511 509 510 504 507 508 503 488 502 493 501 505 506 481 483 468 476 495 498 490 487 491 496 447 500 482 499 474 462 453 464 465 461 457 428 448 427 492 472 471 454 484 478 459 489 485 494 393 440 470 497 463 475 477 480 445 473 452 399 436 419 443 396 407 348 409 423 451 397 420 357 435 366 389 33...
output:
0 0 0 128 128 0 512 256 2048 8192 0 0 32768 0 0 524288 524288 0 0 0 0 4194304 0 4194304 0 8388608 0 0 67108864 0 0 0 536870912 0 0 0 0 0 147483634 0 0 589934536 0 589934536 179869065 179869065 0 0 438952513 0 438952513 877905026 0 0 0 511620083 511620083 46480318 23240159 92960636 92960636 0 0 0 371...
result:
ok 1703 numbers
Test #10:
score: 20
Accepted
time: 3ms
memory: 7288kb
input:
9 511 509 510 505 508 506 507 492 503 496 501 498 504 493 502 484 491 480 482 494 489 476 495 469 490 500 483 467 473 464 497 481 423 478 485 326 440 444 436 391 487 474 406 466 472 486 471 373 454 475 477 451 499 479 432 458 460 393 470 433 463 400 462 414 468 410 384 358 363 402 456 271 325 275 42...
output:
0 0 0 0 0 0 256 0 0 0 0 0 131072 16384 0 0 0 524288 524288 0 0 0 16777216 16777216 16777216 0 0 0 147483634 0 0 294967268 294967268 0 438952513 0 0 0 0 0 0 0 0 0 0 511620083 0 0 0 0 92960636 0 0 92960636 0 974740338 974740338 949480669 0 898961331 949480669 0 0 0 383381198 533524785 533524785 0 5363...
result:
ok 1648 numbers
Test #11:
score: 20
Accepted
time: 3ms
memory: 7228kb
input:
9 511 508 510 504 507 501 509 497 503 499 506 487 495 494 505 474 464 493 452 467 498 500 489 460 482 468 490 491 488 496 502 463 465 360 440 459 492 450 445 453 466 483 476 485 448 443 477 402 436 469 480 417 438 426 456 415 442 429 486 470 481 437 449 458 405 409 455 310 357 368 397 420 457 421 47...
output:
0 0 4 0 0 32 0 0 0 1024 0 0 65536 524288 2097152 0 0 0 0 0 0 0 0 0 16777216 0 0 73741817 73741817 536870912 134217728 0 0 0 0 0 0 147483634 294967268 359738130 359738130 0 0 755810045 0 185921272 185921272 0 371842544 0 0 0 743685088 371842544 974740338 0 0 0 743685088 743685088 0 487370169 97474033...
result:
ok 1641 numbers
Test #12:
score: 20
Accepted
time: 3ms
memory: 7240kb
input:
9 511 508 510 499 502 506 509 494 497 495 489 501 504 498 507 490 480 492 496 488 481 485 482 443 484 500 503 475 487 486 505 419 464 453 471 447 472 466 493 436 477 462 431 438 476 456 470 374 433 412 463 430 425 435 483 410 452 417 468 444 451 478 491 403 418 432 460 309 442 465 389 407 421 382 39...
output:
0 0 0 4 0 0 0 0 0 0 1024 2048 0 0 0 0 4096 0 0 0 0 0 0 0 2097152 2097152 0 0 0 0 0 0 147483634 589934536 589934536 0 0 438952513 511620083 371842544 0 0 0 743685088 371842544 0 0 743685088 487370169 743685088 0 0 0 0 487370169 743685088 974740338 0 0 0 0 974740338 0 0 898961331 797922655 0 797922655...
result:
ok 1656 numbers
Subtask #5:
score: 20
Accepted
Dependency #3:
100%
Accepted
Test #13:
score: 20
Accepted
time: 1765ms
memory: 38820kb
input:
18 262143 262142 262141 262135 262134 262140 262137 262119 262122 262133 262117 262136 262139 262129 262130 262114 262088 262099 262080 262126 262131 262091 262101 262128 262132 262138 262115 262103 262121 262069 262094 262111 262078 261968 262042 262032 262097 262059 262074 262086 262113 262124 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 ...
result:
ok 166527 numbers
Test #14:
score: 20
Accepted
time: 1809ms
memory: 38712kb
input:
18 262143 262141 262142 262139 262135 262140 262136 262138 262126 262129 262130 262132 262134 262122 262118 262137 262082 262090 262083 262103 262112 262121 262123 262131 262128 262133 262127 262105 262111 262085 262106 262124 262125 262066 262080 262055 262048 262069 261865 262096 262102 262068 262...
output:
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 166874 numbers
Test #15:
score: 20
Accepted
time: 1825ms
memory: 38808kb
input:
18 262143 262141 262142 262135 262139 262134 262140 262123 262120 262130 262125 262128 262127 262138 262136 262108 262102 262077 262112 262099 262122 262117 262124 262113 262116 262126 262110 262137 262104 262131 262121 262039 262092 262035 262078 262004 262073 262109 262106 262087 262046 262076 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 166762 numbers
Test #16:
score: 20
Accepted
time: 1815ms
memory: 38744kb
input:
18 262143 262141 262142 262133 262140 262138 262137 262130 262125 262135 262139 262117 262136 262120 262124 262083 262128 262086 262118 262129 262131 262116 262121 262097 262115 262127 262134 262103 262107 262122 262119 262077 262044 262114 262042 262081 262053 262079 262109 262101 262108 262070 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ...
result:
ok 166661 numbers
Subtask #6:
score: 20
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Test #17:
score: 20
Accepted
time: 1793ms
memory: 35848kb
input:
18 262143 262142 262140 262139 262141 262138 262134 262133 262136 262137 262132 262128 262127 262098 262129 262130 262131 262111 262135 262118 262120 262112 262124 262104 262126 262125 262122 262093 262094 262089 262091 262068 262113 262116 262071 262080 262107 262042 262081 262100 262114 262030 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 294967268 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 216755367 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 166366 numbers
Test #18:
score: 20
Accepted
time: 1795ms
memory: 35900kb
input:
18 262143 262141 262142 262134 262138 262128 262140 262131 262132 262135 262137 262116 262125 262121 262139 262120 262089 262101 262127 262122 262114 262124 262136 262094 262102 262118 262119 262112 262117 262130 262133 262065 262093 262073 262045 262096 262046 262108 262051 262083 262115 262025 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 383381198 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 892516375 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 96...
result:
ok 166525 numbers
Test #19:
score: 20
Accepted
time: 1808ms
memory: 35832kb
input:
18 262143 262139 262142 262138 262135 262140 262141 262133 262126 262129 262118 262120 262137 262123 262136 262131 262130 262113 262125 262090 262115 262112 262109 262052 262106 262121 262124 262100 262103 262132 262134 262127 262093 262015 262099 262079 262098 262097 262122 262076 262089 262114 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 438952513 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 373798577 0 0 0 0 ...
result:
ok 166541 numbers
Test #20:
score: 20
Accepted
time: 1766ms
memory: 35824kb
input:
18 262143 262137 262142 262136 262125 262141 262139 262135 262127 262122 262119 262140 262134 262124 262138 262114 262130 262095 262126 262091 262109 262062 262112 262115 262133 262123 262131 262121 262118 262027 262132 262107 262104 262097 262128 262086 262031 262084 262093 261998 262083 262039 262...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 165999 numbers
Extra Test:
score: 0
Extra Test Passed