QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#564103 | #8839. Knocker | ucup-team4435# | AC ✓ | 25ms | 4264kb | C++20 | 7.0kb | 2024-09-14 20:04:50 | 2024-09-14 20:04:50 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repr(i, n) for (int i = (n) - 1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define each(x, a) for (auto &x : a)
#define ar array
#define vec vector
#define range(i, n) rep(i, n)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pair<int, int>>;
using vvi = vector<vi>;
int Bit(int mask, int b) { return (mask >> b) & 1; }
template<class T>
bool ckmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template<class T>
bool ckmax(T &a, const T &b) {
if (b > a) {
a = b;
return true;
}
return false;
}
// [l, r)
template<typename T, typename F>
T FindFirstTrue(T l, T r, const F &predicat) {
--l;
while (r - l > 1) {
T mid = l + (r - l) / 2;
if (predicat(mid)) {
r = mid;
} else {
l = mid;
}
}
return r;
}
template<typename T, typename F>
T FindLastFalse(T l, T r, const F &predicat) {
return FindFirstTrue(l, r, predicat) - 1;
}
const ll INF = 2e18;
const int INFi = 1e9;
template<typename T>
int normalize(T value, int mod) {
if (value < -mod || value >= 2 * mod) value %= mod;
if (value < 0) value += mod;
if (value >= mod) value -= mod;
return value;
}
template<int mod>
struct static_modular_int {
using mint = static_modular_int<mod>;
int value;
static_modular_int() : value(0) {}
static_modular_int(const mint &x) : value(x.value) {}
template<typename T, typename U = std::enable_if_t<std::is_integral<T>::value>>
static_modular_int(T value) : value(normalize(value, mod)) {}
template<typename T>
mint power(T degree) const {
degree = normalize(degree, mod - 1);
mint prod = 1, a = *this;
for (; degree > 0; degree >>= 1, a *= a)
if (degree & 1)
prod *= a;
return prod;
}
mint inv() const {
return power(-1);
}
mint &operator=(const mint &x) {
value = x.value;
return *this;
}
mint &operator+=(const mint &x) {
value += x.value;
if (value >= mod) value -= mod;
return *this;
}
mint &operator-=(const mint &x) {
value -= x.value;
if (value < 0) value += mod;
return *this;
}
mint &operator*=(const mint &x) {
value = int64_t(value) * x.value % mod;
return *this;
}
mint &operator/=(const mint &x) {
return *this *= x.inv();
}
friend mint operator+(const mint &x, const mint &y) {
return mint(x) += y;
}
friend mint operator-(const mint &x, const mint &y) {
return mint(x) -= y;
}
friend mint operator*(const mint &x, const mint &y) {
return mint(x) *= y;
}
friend mint operator/(const mint &x, const mint &y) {
return mint(x) /= y;
}
mint &operator++() {
++value;
if (value == mod) value = 0;
return *this;
}
mint &operator--() {
--value;
if (value == -1) value = mod - 1;
return *this;
}
mint operator++(int) {
mint prev = *this;
value++;
if (value == mod) value = 0;
return prev;
}
mint operator--(int) {
mint prev = *this;
value--;
if (value == -1) value = mod - 1;
return prev;
}
mint operator-() const {
return mint(0) - *this;
}
bool operator==(const mint &x) const {
return value == x.value;
}
bool operator!=(const mint &x) const {
return value != x.value;
}
bool operator<(const mint &x) const {
return value < x.value;
}
template<typename T>
explicit operator T() {
return value;
}
friend std::istream &operator>>(std::istream &in, mint &x) {
std::string s;
in >> s;
x = 0;
for (const auto c: s)
x = x * 10 + (c - '0');
return in;
}
friend std::ostream &operator<<(std::ostream &out, const mint &x) {
return out << x.value;
}
static int primitive_root() {
if constexpr (mod == 1'000'000'007) return 5;
if constexpr (mod == 998'244'353) return 3;
if constexpr (mod == 786433) return 10;
static int root = -1;
if (root != -1)
return root;
std::vector<int> primes;
int value = mod - 1;
for (int i = 2; i * i <= value; i++)
if (value % i == 0) {
primes.push_back(i);
while (value % i == 0)
value /= i;
}
if (value != 1) primes.push_back(value);
for (int r = 2;; r++) {
bool ok = true;
for (auto p: primes) {
if ((mint(r).power((mod - 1) / p)).value == 1) {
ok = false;
break;
}
}
if (ok) return root = r;
}
}
};
// constexpr int MOD = 1'000'000'007;
constexpr int MOD = 998'244'353;
using mint = static_modular_int<MOD>;
void solve() {
int n;
cin >> n;
vi a(n);
rep(i, n) cin >> a[i];
sort(all(a));
a.resize(unique(all(a)) - a.begin());
n = a.size();
reverse(all(a));
const int m = 500;
vector<vector<mint>> dp(n + 1, vector<mint>(m + 1, 0));
dp[0][0] = 1;
mint ans = 0;
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
int rx = a[j];
int lx = (j + 1 == n ? 0 : a[j + 1] + 1);
for (int x = lx; x <= rx; ++x) {
if (x <= (a[i] - x)) continue;
for (int t = 0; t <= min(m, x - 1); ++t) {
dp[j + 1][max(t, a[i] - x)] += dp[i][t];
}
}
}
{
int rx = (!i ? m : a[i - 1] - 1);
for (int mx = 0; mx <= rx; ++mx) {
ans += dp[i][mx];
}
}
}
{
int i = n;
{
int rx = (!i ? m : a[i - 1] - 1);
for (int mx = 0; mx <= rx; ++mx) {
ans += dp[i][mx];
}
}
}
cout << ans << '\n';
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout << setprecision(12) << fixed;
int t = 1;
// cin >> t;
rep(i, t) {
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3560kb
input:
1 5
output:
4
result:
ok 1 number(s): "4"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
2 6 5
output:
7
result:
ok 1 number(s): "7"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
5 1 2 4 8 16
output:
69
result:
ok 1 number(s): "69"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1 139
output:
71
result:
ok 1 number(s): "71"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
2 359 96
output:
3661
result:
ok 1 number(s): "3661"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
3 487 237 391
output:
1727635
result:
ok 1 number(s): "1727635"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
4 411 81 149 407
output:
789553
result:
ok 1 number(s): "789553"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
5 39 221 395 89 173
output:
29269116
result:
ok 1 number(s): "29269116"
Test #9:
score: 0
Accepted
time: 1ms
memory: 3832kb
input:
6 259 270 448 54 426 167
output:
813709483
result:
ok 1 number(s): "813709483"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
7 387 422 398 32 488 136 372
output:
407011330
result:
ok 1 number(s): "407011330"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
8 15 63 451 213 37 209 343 319
output:
141747374
result:
ok 1 number(s): "141747374"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
9 439 407 197 191 291 486 30 307 11
output:
727389889
result:
ok 1 number(s): "727389889"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
10 18 18 71 471 121 362 467 107 138 254
output:
118253787
result:
ok 1 number(s): "118253787"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
11 146 171 316 449 375 434 450 299 202 232 157
output:
400144492
result:
ok 1 number(s): "400144492"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
12 70 311 74 427 232 211 126 83 357 118 97 428
output:
462347314
result:
ok 1 number(s): "462347314"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
13 494 155 320 96 486 476 313 71 13 301 332 376 269
output:
88111202
result:
ok 1 number(s): "88111202"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
14 418 204 77 278 239 457 284 263 372 279 476 416 360 18
output:
651058833
result:
ok 1 number(s): "651058833"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
15 46 344 323 255 301 234 472 47 28 165 415 159 450 451 336
output:
772893469
result:
ok 1 number(s): "772893469"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
16 174 188 377 437 54 498 455 239 183 347 59 199 52 488 147 82
output:
972620652
result:
ok 1 number(s): "972620652"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
17 394 137 134 107 104 275 130 227 339 326 499 251 142 421 470 499 188
output:
899401071
result:
ok 1 number(s): "899401071"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
18 22 481 380 288 166 348 113 215 198 212 246 494 233 459 293 416 318 467
output:
412927759
result:
ok 1 number(s): "412927759"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
19 446 30 434 62 123 317 289 203 354 394 390 238 323 392 308 333 233 25 259
output:
769017546
result:
ok 1 number(s): "769017546"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
20 440 204 481 140 310 354 34 150 184 360 16 301 290 178 138 393 399 260 381 499
output:
602957116
result:
ok 1 number(s): "602957116"
Test #24:
score: 0
Accepted
time: 4ms
memory: 3988kb
input:
100 115 14 432 165 28 396 133 293 448 428 257 20 432 120 90 142 157 353 218 358 394 121 427 229 237 222 94 345 67 360 83 123 320 323 435 393 303 142 6 146 168 346 234 125 117 116 50 105 449 191 423 376 69 300 58 268 381 232 288 41 264 329 37 413 395 25 106 459 474 58 31 135 16 380 113 480 310 459 18...
output:
103940020
result:
ok 1 number(s): "103940020"
Test #25:
score: 0
Accepted
time: 5ms
memory: 3784kb
input:
101 39 358 381 335 89 376 12 473 104 111 401 59 22 157 401 263 71 307 440 302 142 398 437 408 298 134 315 398 379 230 309 201 111 255 44 302 237 13 40 360 269 268 219 487 10 200 361 349 67 157 241 416 162 324 454 2 460 353 335 345 275 435 76 499 426 390 83 82 265 192 376 217 339 392 384 206 266 246 ...
output:
265095240
result:
ok 1 number(s): "265095240"
Test #26:
score: 0
Accepted
time: 4ms
memory: 3752kb
input:
102 168 499 435 17 343 153 496 461 259 89 341 7 112 294 224 180 294 70 162 43 287 380 254 291 51 342 332 259 499 100 228 472 198 392 153 402 263 292 481 267 62 382 308 442 7 180 469 389 481 112 150 172 151 453 146 440 51 178 486 161 182 52 207 481 458 256 71 206 364 326 232 208 354 107 260 340 426 3...
output:
417756099
result:
ok 1 number(s): "417756099"
Test #27:
score: 0
Accepted
time: 5ms
memory: 3744kb
input:
103 296 355 489 494 404 418 479 449 119 475 484 47 11 331 47 97 412 320 180 296 35 466 263 470 408 63 54 119 312 471 454 242 297 324 157 310 197 367 219 174 367 293 89 396 195 263 484 429 407 283 468 428 233 273 246 175 438 299 237 465 398 169 246 55 193 313 356 330 155 164 77 290 73 119 135 270 382...
output:
556170265
result:
ok 1 number(s): "556170265"
Test #28:
score: 0
Accepted
time: 4ms
memory: 3624kb
input:
104 16 495 234 268 158 195 154 141 274 157 220 98 305 265 62 14 338 82 402 37 284 244 69 46 469 271 275 172 228 341 372 321 384 460 266 410 222 430 457 92 456 215 74 55 384 347 92 173 321 238 82 276 30 297 438 409 28 112 92 270 101 478 82 36 416 474 333 454 254 298 126 372 88 323 406 201 31 402 181 ...
output:
728253520
result:
ok 1 number(s): "728253520"
Test #29:
score: 0
Accepted
time: 4ms
memory: 3904kb
input:
105 144 340 196 449 208 268 342 425 134 136 467 138 395 302 385 123 253 332 420 482 224 21 78 225 326 479 292 237 244 7 394 91 175 393 375 114 156 5 194 499 56 126 367 9 381 430 107 213 235 408 196 223 111 222 334 156 119 232 243 290 112 95 121 314 447 340 322 77 45 124 279 171 103 39 282 131 191 28...
output:
986376165
result:
ok 1 number(s): "986376165"
Test #30:
score: 0
Accepted
time: 5ms
memory: 3744kb
input:
106 68 184 442 119 269 236 313 413 289 22 111 382 485 235 400 40 475 391 143 30 177 107 395 108 183 199 217 98 161 378 120 465 466 325 380 418 386 80 240 110 53 240 444 464 69 218 23 253 353 363 309 275 408 246 27 390 6 57 290 94 20 404 160 92 182 397 403 497 144 258 328 253 414 50 157 265 147 68 19...
output:
9022876
result:
ok 1 number(s): "9022876"
Test #31:
score: 0
Accepted
time: 5ms
memory: 3688kb
input:
107 196 325 495 301 23 13 296 105 149 204 51 125 280 272 223 161 402 141 365 271 425 89 108 287 244 408 438 447 473 56 38 440 361 257 489 123 116 451 477 324 154 459 428 314 66 494 38 497 267 34 231 327 194 170 231 328 289 178 349 398 31 317 291 74 213 58 84 325 243 96 173 39 441 62 33 195 307 355 3...
output:
612020389
result:
ok 1 number(s): "612020389"
Test #32:
score: 0
Accepted
time: 5ms
memory: 3948kb
input:
108 416 373 241 278 276 86 484 389 304 386 194 369 166 206 238 79 316 403 383 24 174 163 118 362 101 320 455 12 285 426 468 18 153 190 301 235 49 229 419 231 447 73 413 269 255 281 146 241 193 488 345 71 479 195 127 63 380 299 204 406 234 139 330 160 245 424 73 448 34 230 29 326 457 470 304 126 263 ...
output:
898878045
result:
ok 1 number(s): "898878045"
Test #33:
score: 0
Accepted
time: 6ms
memory: 3688kb
input:
109 44 25 499 460 338 55 455 81 460 69 134 217 256 447 61 496 243 153 105 265 114 248 423 246 162 336 177 373 406 389 491 85 240 326 410 131 471 100 452 446 47 496 298 223 444 365 457 77 311 455 458 327 72 119 319 297 63 420 47 19 245 244 165 438 468 289 154 368 133 364 374 112 472 481 383 260 219 3...
output:
35955391
result:
ok 1 number(s): "35955391"
Test #34:
score: 0
Accepted
time: 5ms
memory: 3688kb
input:
110 230 404 150 322 421 92 96 29 290 239 69 176 235 425 83 56 305 197 23 248 393 385 439 60 61 228 63 254 213 86 373 341 123 488 128 452 139 473 349 13 387 142 133 323 108 488 400 126 104 128 146 15 342 245 412 382 305 494 375 42 221 112 30 381 67 194 435 357 238 21 218 407 445 476 186 264 186 361 1...
output:
124946343
result:
ok 1 number(s): "124946343"
Test #35:
score: 0
Accepted
time: 16ms
memory: 3860kb
input:
480 479 349 2 441 376 375 215 79 326 245 349 93 256 6 42 86 37 489 357 107 100 380 476 241 278 420 265 405 161 318 26 449 265 7 206 393 185 317 317 50 223 461 48 470 489 327 318 142 289 421 352 270 98 68 430 481 340 253 167 359 56 489 338 389 389 322 43 64 232 328 498 227 154 493 137 288 469 117 377...
output:
10136774
result:
ok 1 number(s): "10136774"
Test #36:
score: 0
Accepted
time: 14ms
memory: 3900kb
input:
481 199 397 260 419 130 152 198 67 481 428 300 440 346 247 57 3 156 47 283 52 348 157 486 317 339 128 191 266 77 292 49 220 260 440 315 289 107 188 55 161 323 371 329 424 178 115 130 478 11 388 170 218 87 493 30 420 431 78 10 163 463 107 377 167 420 187 328 200 23 166 151 13 373 208 216 422 117 200 ...
output:
650157965
result:
ok 1 number(s): "650157965"
Test #37:
score: 0
Accepted
time: 15ms
memory: 3924kb
input:
482 327 346 6 100 192 224 373 351 137 314 240 184 436 476 380 420 378 1 302 100 493 435 495 496 196 40 208 23 94 162 275 94 347 76 423 401 41 263 497 68 320 294 110 379 367 198 249 222 129 47 79 270 168 17 222 462 317 199 365 479 474 212 212 445 143 53 113 120 122 300 200 299 196 220 295 148 277 487...
output:
255690299
result:
ok 1 number(s): "255690299"
Test #38:
score: 0
Accepted
time: 17ms
memory: 3852kb
input:
483 251 190 59 270 445 397 357 43 496 292 179 428 230 421 395 338 293 355 24 45 241 317 300 379 257 56 429 384 10 33 193 364 242 304 236 1 67 338 234 486 421 204 95 37 363 282 61 466 43 13 205 322 465 441 118 493 204 320 221 283 178 33 251 223 379 214 294 243 117 434 45 382 211 424 363 282 437 70 28...
output:
271515425
result:
ok 1 number(s): "271515425"
Test #39:
score: 0
Accepted
time: 15ms
memory: 3924kb
input:
484 379 330 305 248 495 174 236 31 356 474 119 171 117 151 218 447 15 118 42 286 490 299 118 58 318 265 150 41 323 403 419 339 33 441 37 205 500 209 472 189 214 319 183 492 52 261 372 6 161 172 319 374 250 466 310 431 487 441 268 88 381 138 86 205 410 271 79 71 216 260 402 372 226 140 238 213 189 35...
output:
503059663
result:
ok 1 number(s): "503059663"
Test #40:
score: 0
Accepted
time: 15ms
memory: 3856kb
input:
485 99 175 267 225 56 247 15 19 11 361 59 211 219 84 233 364 134 72 60 39 238 76 331 442 175 177 167 298 443 69 145 213 120 373 350 9 434 488 209 300 315 37 168 138 49 345 184 46 87 435 432 321 140 298 410 165 374 458 123 404 96 255 422 278 441 137 364 491 315 98 246 454 241 151 114 347 350 144 38 4...
output:
764056692
result:
ok 1 number(s): "764056692"
Test #41:
score: 0
Accepted
time: 11ms
memory: 3628kb
input:
486 227 223 12 407 310 216 203 7 371 339 202 263 309 121 56 485 60 130 282 279 383 162 340 313 32 89 388 159 255 440 63 484 411 9 162 214 460 359 255 14 107 152 449 297 237 429 292 290 1 297 46 169 129 414 102 400 465 79 478 208 299 372 461 68 164 2 353 114 106 232 295 49 256 163 193 73 202 227 383 ...
output:
47640924
result:
ok 1 number(s): "47640924"
Test #42:
score: 0
Accepted
time: 15ms
memory: 3888kb
input:
487 151 364 66 385 63 289 378 495 26 21 142 302 399 54 379 402 475 84 4 32 131 440 350 196 93 105 301 316 376 310 290 62 11 442 67 314 394 126 196 125 104 74 230 251 426 12 307 330 119 60 160 425 210 439 103 338 56 200 25 12 311 477 296 346 195 59 126 238 205 366 448 335 475 71 260 207 158 13 36 274...
output:
113472363
result:
ok 1 number(s): "113472363"
Test #43:
score: 0
Accepted
time: 15ms
memory: 3876kb
input:
488 75 16 324 258 421 65 361 483 182 408 81 250 194 92 394 319 197 142 226 273 380 217 167 79 142 314 319 73 484 180 16 332 98 78 72 222 123 201 230 236 205 485 23 206 331 300 415 370 33 423 274 169 7 363 499 72 442 321 176 328 14 299 335 124 227 221 115 362 496 500 497 121 298 82 136 137 318 96 189...
output:
137594120
result:
ok 1 number(s): "137594120"
Test #44:
score: 0
Accepted
time: 14ms
memory: 3876kb
input:
489 203 156 69 236 174 34 37 471 349 386 33 289 284 25 217 32 420 97 244 218 320 7 472 258 499 226 40 434 500 50 434 411 389 10 181 322 353 72 467 246 498 99 8 364 19 75 430 114 151 186 195 221 293 387 395 319 33 146 223 133 229 404 170 402 462 86 104 485 95 30 150 408 313 94 215 68 70 487 34 97 397...
output:
298391222
result:
ok 1 number(s): "298391222"
Test #45:
score: 0
Accepted
time: 11ms
memory: 3860kb
input:
490 197 239 425 110 65 72 282 122 167 56 160 57 59 15 240 92 482 140 354 497 395 144 180 265 410 117 438 123 412 340 112 167 68 376 3 439 417 253 364 314 338 53 139 464 480 198 477 267 444 358 74 409 63 322 284 200 59 312 359 156 13 476 331 345 61 299 385 178 8 291 481 203 83 484 221 72 241 315 357 ...
output:
887623098
result:
ok 1 number(s): "887623098"
Test #46:
score: 0
Accepted
time: 15ms
memory: 3852kb
input:
491 122 379 170 279 319 144 457 110 323 238 99 96 353 244 63 9 408 390 77 442 336 218 498 148 267 134 159 380 224 19 42 233 463 308 8 347 443 316 305 220 438 168 216 418 169 486 288 307 166 221 496 461 156 438 192 138 150 433 406 460 216 81 370 122 93 356 158 98 299 333 338 489 98 496 97 206 197 398...
output:
651365392
result:
ok 1 number(s): "651365392"
Test #47:
score: 0
Accepted
time: 11ms
memory: 3688kb
input:
492 250 223 224 257 380 421 144 394 182 420 243 148 443 485 78 426 323 449 299 490 84 495 7 328 328 46 380 36 48 389 268 312 254 445 321 448 376 94 147 139 231 90 201 373 358 69 100 51 284 484 110 217 145 270 384 372 241 54 465 277 227 495 409 104 20 221 147 222 398 467 183 83 113 8 368 432 357 185 ...
output:
970348378
result:
ok 1 number(s): "970348378"
Test #48:
score: 0
Accepted
time: 15ms
memory: 3904kb
input:
493 174 376 470 438 134 390 115 86 338 102 182 188 329 214 401 47 45 199 317 231 37 81 220 403 377 254 397 101 157 259 186 82 341 377 429 356 310 465 385 342 332 1 494 235 354 357 412 91 198 142 224 256 226 387 280 107 128 379 308 81 431 316 244 178 51 383 135 345 189 101 232 166 332 224 243 67 209 ...
output:
805149701
result:
ok 1 number(s): "805149701"
Test #49:
score: 0
Accepted
time: 15ms
memory: 3988kb
input:
494 98 220 431 416 387 463 303 74 197 285 134 135 124 456 416 464 472 461 39 176 285 63 230 82 234 270 119 154 277 425 413 160 336 14 38 252 336 40 326 452 125 115 71 190 43 440 223 27 316 109 337 12 23 219 472 45 219 500 163 385 338 421 283 468 82 440 216 469 288 427 385 156 155 223 119 497 462 159...
output:
277190183
result:
ok 1 number(s): "277190183"
Test #50:
score: 0
Accepted
time: 11ms
memory: 3992kb
input:
495 22 65 485 394 245 240 286 62 57 171 74 175 214 185 239 73 386 223 57 225 226 341 343 465 295 479 340 15 385 92 127 431 231 242 43 364 462 115 64 167 225 334 56 336 232 420 35 67 242 268 155 64 309 335 369 88 105 313 18 201 349 242 414 246 317 305 397 93 387 265 433 238 170 235 186 427 122 446 41...
output:
7825762
result:
ok 1 number(s): "7825762"
Test #51:
score: 0
Accepted
time: 15ms
memory: 3980kb
input:
496 150 205 231 63 499 4 461 50 212 149 309 227 304 426 358 490 312 474 75 373 474 426 352 348 152 95 61 376 210 462 353 9 318 378 152 260 487 486 97 278 222 448 349 494 432 300 450 107 156 235 65 308 402 360 265 26 196 434 361 210 53 347 454 23 40 467 182 216 178 399 278 25 390 451 266 61 78 232 68...
output:
620186888
result:
ok 1 number(s): "620186888"
Test #52:
score: 0
Accepted
time: 15ms
memory: 3904kb
input:
497 74 49 284 245 252 281 445 38 368 332 453 266 407 359 77 407 227 236 1 114 223 204 361 28 213 111 282 429 22 332 79 76 110 311 465 168 421 61 39 388 323 167 130 449 121 383 466 351 274 393 191 64 187 488 457 260 479 259 420 14 268 464 493 301 72 24 467 340 276 33 135 311 201 462 141 492 238 315 4...
output:
961403387
result:
ok 1 number(s): "961403387"
Test #53:
score: 0
Accepted
time: 15ms
memory: 3900kb
input:
498 498 394 234 223 314 58 324 218 227 218 392 10 497 101 196 325 153 486 19 367 367 278 371 103 274 319 3 290 130 203 497 358 5 447 265 269 151 340 276 399 412 281 411 403 118 171 73 391 188 360 304 115 268 308 353 495 366 380 275 126 175 273 328 283 307 389 148 260 67 167 184 201 216 166 16 422 90...
output:
362186337
result:
ok 1 number(s): "362186337"
Test #54:
score: 0
Accepted
time: 17ms
memory: 3872kb
input:
499 422 46 288 404 271 27 103 206 383 196 36 254 87 330 211 446 68 44 241 108 116 68 188 282 131 28 20 343 455 177 427 128 500 379 374 177 381 211 14 10 217 396 396 62 307 254 89 431 306 19 214 359 65 437 249 433 457 1 322 134 186 391 163 357 338 255 433 87 462 197 41 488 39 382 492 352 342 185 423 ...
output:
199497745
result:
ok 1 number(s): "199497745"
Test #55:
score: 0
Accepted
time: 15ms
memory: 3988kb
input:
500 289 21 238 284 123 225 289 119 177 391 336 381 77 104 450 132 478 38 397 144 17 466 244 65 287 402 434 198 140 353 77 391 253 154 248 16 103 296 453 433 334 185 459 404 348 363 414 478 495 454 218 325 466 180 404 119 57 36 17 378 424 374 148 434 141 61 100 239 406 461 76 3 459 481 242 200 50 467...
output:
841936052
result:
ok 1 number(s): "841936052"
Test #56:
score: 0
Accepted
time: 5ms
memory: 3940kb
input:
100 157 244 41 308 202 293 121 394 474 16 232 116 345 413 90 473 146 237 133 393 470 328 43 120 83 69 165 435 52 14 388 257 185 6 376 20 423 125 176 449 440 448 168 451 228 135 427 28 94 186 234 320 381 200 82 53 358 380 395 304 310 428 300 113 183 31 288 329 480 114 25 268 360 118 209 142 218 123 1...
output:
214021872
result:
ok 1 number(s): "214021872"
Test #57:
score: 0
Accepted
time: 5ms
memory: 3912kb
input:
101 130 473 408 309 291 416 401 386 231 206 379 22 2 460 499 360 366 201 358 10 274 322 398 426 302 305 230 60 164 296 82 176 200 392 437 335 67 353 491 246 237 39 268 487 52 419 275 219 142 40 345 266 298 59 159 293 183 104 382 76 435 265 61 222 376 30 162 134 89 13 440 390 324 5 217 349 241 269 45...
output:
320932481
result:
ok 1 number(s): "320932481"
Test #58:
score: 0
Accepted
time: 5ms
memory: 3748kb
input:
102 225 215 74 254 206 173 172 256 384 7 208 148 51 89 496 17 342 199 160 46 128 271 71 435 402 425 43 389 328 228 294 472 265 52 453 461 391 138 198 267 260 11 153 182 407 216 440 162 287 339 112 326 113 146 2 380 422 442 341 486 180 327 178 224 481 62 392 291 45 252 292 136 354 119 100 259 308 207...
output:
196727327
result:
ok 1 number(s): "196727327"
Test #59:
score: 0
Accepted
time: 3ms
memory: 3688kb
input:
103 219 78 60 382 404 73 5 465 46 296 438 346 89 259 71 47 150 115 155 449 297 119 54 452 262 169 331 273 428 336 471 247 157 290 251 30 466 242 180 367 347 418 293 310 311 312 261 320 398 313 489 330 463 164 250 44 324 468 246 263 96 35 388 55 332 356 197 355 412 454 135 407 495 237 375 147 484 494...
output:
130869905
result:
ok 1 number(s): "130869905"
Test #60:
score: 0
Accepted
time: 5ms
memory: 3784kb
input:
104 452 410 460 154 173 28 333 74 495 18 402 284 321 31 478 459 444 457 394 242 92 82 16 297 355 195 236 270 276 486 172 251 141 101 126 127 275 215 146 341 266 238 456 448 99 198 112 392 323 216 338 85 30 98 244 454 409 91 271 228 140 157 247 268 80 48 152 298 262 274 372 222 201 158 438 37 36 62 4...
output:
712109932
result:
ok 1 number(s): "712109932"
Test #61:
score: 0
Accepted
time: 5ms
memory: 3688kb
input:
105 126 78 213 419 107 208 124 56 11 354 260 134 223 265 444 204 171 156 302 49 235 385 131 335 482 92 393 95 367 282 332 264 38 123 7 281 53 175 112 77 237 9 121 236 136 442 217 292 279 479 191 447 5 232 51 153 224 103 39 70 222 225 467 271 164 299 499 340 408 138 194 314 45 322 381 216 425 253 196...
output:
812717428
result:
ok 1 number(s): "812717428"
Test #62:
score: 0
Accepted
time: 5ms
memory: 3680kb
input:
106 162 363 6 316 253 313 246 466 258 391 80 183 94 215 406 53 265 27 55 119 380 408 108 184 290 23 269 397 325 182 444 144 244 382 413 464 83 92 411 273 399 236 414 400 378 120 110 157 453 240 199 395 12 403 435 292 425 68 135 289 330 69 442 111 311 218 497 353 278 235 279 4 72 485 22 57 328 161 40...
output:
663636820
result:
ok 1 number(s): "663636820"
Test #63:
score: 0
Accepted
time: 5ms
memory: 3908kb
input:
107 58 4 13 125 328 494 64 23 489 314 56 408 426 440 325 198 47 317 361 278 154 178 196 74 383 8 84 257 347 495 244 133 402 391 62 291 446 441 365 429 425 31 151 11 230 428 213 38 498 34 170 51 289 54 89 194 337 473 327 272 267 96 173 90 203 243 335 307 280 364 287 103 404 36 231 451 108 271 39 398 ...
output:
771905965
result:
ok 1 number(s): "771905965"
Test #64:
score: 0
Accepted
time: 6ms
memory: 3948kb
input:
108 246 363 215 136 212 63 479 166 111 72 386 455 299 389 71 304 189 151 91 426 131 330 356 462 144 146 424 447 484 369 263 319 452 378 285 457 301 404 278 488 160 29 416 73 490 86 468 139 415 12 295 269 204 255 206 193 373 68 320 18 448 390 276 163 281 78 49 234 401 394 231 326 3 79 406 153 316 113...
output:
532309769
result:
ok 1 number(s): "532309769"
Test #65:
score: 0
Accepted
time: 6ms
memory: 3624kb
input:
109 323 243 69 425 336 406 496 410 444 248 27 454 81 44 447 20 100 177 55 154 133 84 162 374 387 77 15 423 163 206 7 174 112 389 265 446 356 353 370 119 455 420 365 495 131 175 153 134 281 167 493 19 457 114 287 246 47 159 76 289 471 359 61 500 413 409 311 244 319 34 460 298 63 138 223 25 364 383 47...
output:
930337178
result:
ok 1 number(s): "930337178"
Test #66:
score: 0
Accepted
time: 5ms
memory: 3696kb
input:
110 146 221 437 435 452 239 96 341 208 425 365 83 409 126 476 201 319 23 352 382 324 275 393 60 150 204 128 494 238 226 235 419 113 142 305 122 373 159 69 56 412 363 13 445 421 63 387 300 139 463 157 388 407 108 194 186 375 197 7 86 245 213 292 112 322 228 385 104 4 218 61 376 364 123 495 469 473 31...
output:
314572840
result:
ok 1 number(s): "314572840"
Test #67:
score: 0
Accepted
time: 23ms
memory: 4164kb
input:
480 92 129 93 422 80 330 435 107 447 234 187 344 249 221 195 282 389 301 469 320 433 253 437 17 203 310 400 498 291 154 274 144 379 37 4 374 352 90 329 495 326 269 333 401 182 89 220 259 119 256 101 77 2 186 30 127 171 153 46 96 241 166 136 69 257 109 306 79 118 402 123 481 42 237 115 158 432 12 194...
output:
292678741
result:
ok 1 number(s): "292678741"
Test #68:
score: 0
Accepted
time: 24ms
memory: 4164kb
input:
481 209 491 12 379 344 272 281 49 388 128 236 157 443 130 473 42 190 180 331 234 247 448 122 303 419 58 165 412 98 222 119 208 21 376 362 315 374 278 11 196 330 86 380 110 238 364 216 149 391 204 384 497 30 151 118 249 436 360 275 117 195 160 134 323 357 337 458 47 29 219 370 390 457 427 434 5 267 3...
output:
460958118
result:
ok 1 number(s): "460958118"
Test #69:
score: 0
Accepted
time: 19ms
memory: 4120kb
input:
482 379 400 281 245 53 429 353 168 338 308 79 250 460 447 374 107 310 249 88 359 393 23 267 263 274 94 212 56 174 480 68 217 114 54 288 264 472 2 377 326 48 420 167 462 346 39 70 499 207 482 493 330 454 354 445 170 232 401 437 169 137 293 362 198 230 407 236 349 27 380 408 130 360 322 417 291 122 37...
output:
917943261
result:
ok 1 number(s): "917943261"
Test #70:
score: 0
Accepted
time: 23ms
memory: 4188kb
input:
483 407 240 454 165 429 366 445 111 468 189 340 500 219 109 449 265 405 108 210 392 114 168 483 257 127 118 187 22 255 57 410 487 68 305 238 44 88 343 277 30 59 295 335 161 129 90 395 10 259 495 215 258 35 230 285 124 331 456 332 85 178 364 409 398 377 182 24 337 311 31 158 243 260 278 263 192 202 4...
output:
656298914
result:
ok 1 number(s): "656298914"
Test #71:
score: 0
Accepted
time: 23ms
memory: 4264kb
input:
484 90 416 36 274 103 38 436 84 339 285 98 207 158 143 241 247 189 112 20 261 67 494 293 221 374 397 373 336 332 440 81 118 425 352 308 344 204 253 454 174 488 127 414 393 212 428 134 405 124 384 168 478 5 246 481 376 403 486 86 485 346 270 76 146 79 394 180 236 123 250 421 70 182 130 192 312 350 16...
output:
147067328
result:
ok 1 number(s): "147067328"
Test #72:
score: 0
Accepted
time: 23ms
memory: 4240kb
input:
485 217 295 308 421 203 215 192 130 302 339 191 3 152 453 355 84 327 436 201 390 394 359 145 282 45 39 230 447 227 278 407 169 185 352 113 30 102 162 171 17 54 103 189 234 11 6 99 73 354 78 353 291 101 371 405 229 266 256 312 109 471 183 173 426 245 458 81 367 31 273 287 338 434 476 382 283 334 416 ...
output:
547249250
result:
ok 1 number(s): "547249250"
Test #73:
score: 0
Accepted
time: 23ms
memory: 4152kb
input:
486 15 118 276 462 494 30 76 342 356 31 164 401 197 27 148 425 130 353 64 162 278 78 13 127 343 367 265 7 113 471 352 155 443 293 484 363 377 178 491 36 86 147 221 132 232 250 461 239 303 33 361 188 149 59 35 423 141 372 37 418 4 39 66 80 489 310 301 101 493 350 199 386 285 41 389 422 451 436 400 33...
output:
961562445
result:
ok 1 number(s): "961562445"
Test #74:
score: 0
Accepted
time: 23ms
memory: 4256kb
input:
487 450 104 136 478 457 83 141 472 62 422 146 164 412 474 265 222 379 24 21 95 308 180 87 395 50 17 268 296 463 174 498 153 227 258 14 23 318 434 484 423 398 445 56 483 469 402 246 43 105 298 451 311 431 44 10 102 28 396 163 259 67 211 11 196 267 489 313 353 252 371 470 92 359 19 245 149 120 490 7 4...
output:
400842612
result:
ok 1 number(s): "400842612"
Test #75:
score: 0
Accepted
time: 23ms
memory: 4136kb
input:
488 314 61 238 362 36 313 375 470 157 209 292 455 264 205 206 380 66 409 336 417 329 306 91 113 473 86 265 236 189 32 10 17 28 355 423 219 48 444 472 288 459 223 5 94 133 283 322 356 452 326 9 395 297 400 248 145 453 180 211 82 161 287 124 343 318 498 75 448 260 332 461 63 317 390 55 325 227 182 433...
output:
735863486
result:
ok 1 number(s): "735863486"
Test #76:
score: 0
Accepted
time: 20ms
memory: 4124kb
input:
489 419 377 41 241 392 11 406 283 375 17 55 498 258 360 373 32 4 381 478 391 472 371 121 264 475 218 190 311 309 219 369 54 162 180 271 305 338 262 275 42 172 376 354 418 349 34 61 231 205 199 115 128 415 232 223 310 494 196 106 77 210 16 114 45 348 94 243 451 113 107 109 33 456 40 268 469 274 100 2...
output:
137351284
result:
ok 1 number(s): "137351284"
Test #77:
score: 0
Accepted
time: 19ms
memory: 4172kb
input:
490 248 487 230 287 452 247 305 427 111 202 216 60 208 323 281 86 413 284 379 94 231 16 317 26 43 244 5 236 79 71 135 232 149 142 58 431 259 299 162 4 178 481 181 96 157 245 432 193 327 46 429 498 456 392 240 201 203 315 260 34 450 125 20 124 100 410 497 14 351 307 30 407 334 285 297 426 104 81 174 ...
output:
443596815
result:
ok 1 number(s): "443596815"
Test #78:
score: 0
Accepted
time: 23ms
memory: 4172kb
input:
491 356 459 449 266 164 279 100 373 59 367 258 181 254 316 150 151 27 446 248 247 322 64 329 433 253 390 358 307 115 438 479 50 172 208 161 144 318 193 238 348 86 388 73 165 282 257 496 122 421 465 273 209 264 231 129 425 475 347 30 196 21 33 52 400 98 22 66 413 414 126 377 56 232 352 387 96 82 379 ...
output:
823764149
result:
ok 1 number(s): "823764149"
Test #79:
score: 0
Accepted
time: 23ms
memory: 4188kb
input:
492 434 357 381 115 252 38 61 250 277 440 228 94 133 431 134 460 336 400 41 428 11 76 295 374 77 500 117 7 253 44 422 407 329 28 406 401 291 63 100 241 58 251 64 196 75 282 138 254 223 391 46 392 360 88 398 320 60 193 353 449 19 306 304 456 240 158 89 383 416 396 350 35 351 288 17 107 438 385 191 69...
output:
876545492
result:
ok 1 number(s): "876545492"
Test #80:
score: 0
Accepted
time: 20ms
memory: 4188kb
input:
493 327 425 300 145 316 74 298 240 101 260 267 446 233 416 293 442 62 99 412 144 456 341 247 122 324 114 357 481 342 218 166 499 365 497 366 171 226 343 328 427 196 477 232 400 353 219 46 110 375 297 361 108 291 162 492 469 8 65 311 5 29 239 284 261 302 111 369 92 25 283 154 209 205 485 241 12 331 4...
output:
843154723
result:
ok 1 number(s): "843154723"
Test #81:
score: 0
Accepted
time: 23ms
memory: 4120kb
input:
494 2 87 289 394 263 271 478 128 273 370 264 81 429 55 371 298 169 203 415 377 332 410 221 347 408 267 82 420 287 135 474 282 246 122 138 1 497 83 165 312 435 41 32 176 129 417 110 222 315 172 177 397 146 59 232 116 344 84 164 499 35 288 23 329 11 255 54 294 137 36 230 250 244 234 406 240 72 414 496...
output:
776332967
result:
ok 1 number(s): "776332967"
Test #82:
score: 0
Accepted
time: 23ms
memory: 4120kb
input:
495 14 415 177 36 322 234 211 95 59 289 416 495 487 94 459 213 259 2 455 22 273 27 442 338 418 492 186 180 265 66 284 156 220 335 420 489 42 426 419 424 423 89 124 185 199 431 126 443 368 488 477 457 352 344 151 422 225 208 334 133 56 254 120 212 255 158 187 472 483 271 193 413 104 61 46 461 87 389 ...
output:
471345298
result:
ok 1 number(s): "471345298"
Test #83:
score: 0
Accepted
time: 25ms
memory: 4124kb
input:
496 264 281 251 79 72 462 277 272 52 334 490 367 271 463 486 232 260 470 37 476 262 345 129 148 56 4 245 467 103 413 484 81 153 200 254 439 414 104 274 178 444 302 325 363 196 71 47 164 370 24 187 443 430 25 102 259 445 452 223 130 477 65 494 331 145 379 293 114 400 28 11 425 237 14 471 368 231 224 ...
output:
839614650
result:
ok 1 number(s): "839614650"
Test #84:
score: 0
Accepted
time: 23ms
memory: 4152kb
input:
497 52 13 498 3 134 288 224 417 103 238 129 428 231 233 30 448 255 172 208 127 314 31 371 66 283 468 91 443 372 424 94 402 135 109 8 438 243 39 413 87 396 68 138 256 93 96 293 421 203 461 359 391 194 445 83 119 429 206 81 84 61 21 217 253 324 497 349 331 86 333 114 14 252 223 149 218 181 95 145 214 ...
output:
164400584
result:
ok 1 number(s): "164400584"
Test #85:
score: 0
Accepted
time: 23ms
memory: 4264kb
input:
498 39 154 200 25 416 137 452 383 462 121 186 31 148 286 346 91 283 208 17 364 255 131 447 126 239 256 118 64 162 500 159 44 397 211 459 81 261 277 273 250 187 497 8 96 312 370 350 310 466 276 85 180 471 265 272 396 107 488 384 411 463 303 119 281 145 136 454 74 321 231 328 401 386 309 458 389 79 18...
output:
144353993
result:
ok 1 number(s): "144353993"
Test #86:
score: 0
Accepted
time: 20ms
memory: 4200kb
input:
499 225 282 249 323 204 414 485 173 30 224 20 328 359 340 312 27 188 123 477 468 120 454 84 72 109 217 214 354 440 266 301 113 76 355 496 133 236 462 276 145 291 408 482 43 222 370 348 403 309 487 493 316 436 357 278 138 3 256 57 322 320 31 203 377 54 189 363 136 137 129 212 228 191 206 100 116 81 1...
output:
797920189
result:
ok 1 number(s): "797920189"
Test #87:
score: 0
Accepted
time: 24ms
memory: 4168kb
input:
500 318 345 351 143 62 330 82 454 236 69 470 371 8 327 10 415 347 24 135 331 495 104 196 289 34 252 83 488 107 354 18 74 307 244 473 487 451 373 264 410 208 311 281 426 88 405 399 79 251 431 241 465 233 279 85 53 493 484 456 438 93 97 124 167 368 4 15 26 302 183 420 468 133 361 40 294 393 217 242 49...
output:
178649420
result:
ok 1 number(s): "178649420"
Extra Test:
score: 0
Extra Test Passed