QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#59090 | #101. Ticket-punch | hhblw | AC ✓ | 126ms | 15648kb | C++98 | 11.3kb | 2022-10-27 22:17:19 | 2022-10-27 22:17:20 |
Judging History
answer
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
FILE *g_f_;
int g_s_;
#define freopen(a, b, c) (g_f_ = freopen(a, b, c))
#define scanf(...) (g_s_ = scanf(__VA_ARGS__))
#define sscanf(...) (g_s_ = sscanf(__VA_ARGS__))
template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }
typedef long double ld;
// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;
// Types
typedef signed long long i64;
typedef unsigned long long u64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;
const int nm00[] = {0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16};
const int nm01[] = {4,17,18,19,20,21,22,23,24};
const int nm10[] = {0,9,13,7,14,2,11,5,6};
const int nm11[] = {4,17,18,21,19,24};
const int nm20[] = {0,1,5,7,8,9,10,13,15};
const int nm21[] = {4,17,19,20,21,22};
const int nm30[] = {0,1,5,9,10,13,15,7};
const int nm31[] = {4,21,17,22,19};
const int sq00[] = {0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16};
const int sq01[] = {4,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32};
const int sq10[] = {0,2,5,6,7,9,11,13,14};
const int sq11[] = {4,17,20,21,22,23,25,26,29,30};
const int sq20[] = {0,1,5,7,8,9,10,13,15};
const int sq21[] = {4,17,19,21,23,24,25,26,27,28};
const int sq30[] = {0,1,5,8,9,10,13,15};
const int sq31[] = {4,17,19,21,24,25,26,27,28};
const int sq40[] = {0,9,10,5};
const int sq41[] = {4,17,25,26,21};
const int sq50[] = {0,1,3,9,5,10,8,15,16};
const int sq51[] = {4,17,18,19,21,24,25,27,28,31};
const int sq60[] = {0,9,10,5};
const int sq61[] = {4,17,25,26,21};
const int sq70[] = {0,1,3,9,5,10,8,15,16};
const int sq71[] = {4,17,18,19,21,24,25,27,28,31};
const int MOD = 1000000007;
const int MAXN = 1001;
int d[MAXN + 2][MAXN + 2];
int ds[MAXN + 2][MAXN + 2];
int p2[MAXN * MAXN + 1];
int r2[4];
inline int mypow(int a, i64 k)
{
if (!k) return 1;
if (k == 1) return a;
int ans = mypow(a, k/2);
ans = ans * (i64)ans % MOD;
if (k & 1) ans = ans * (i64)a % MOD;
return ans;
}
inline int solve_one(int n)
{
if (n == 1) return 1;
n -= 2;
int ans = p2[n] + p2[(n + 1) / 2];
if (ans >= MOD) ans -= MOD;
return ans * (i64)r2[1] % MOD;
// return (mypow(2, n) + mypow(2, (n + 1) / 2)) % MOD * (i64)mypow(2, MOD-2) % MOD;
}
inline void add(int &a, int b)
{
a += b;
a -= (a >= MOD) * MOD;
}
inline void sub(int &a, int b)
{
a -= b;
a += (a < 0) * MOD;
}
inline int pow2(i64 k)
{
if (k < MAXN * MAXN) return p2[k];
else return mypow(2, k);
}
i64 s_eq(int n)
{
if (n == 1) return 1;
i64 c[33] = {};
c[0] = c[1] = c[2] = c[3] = 1;
c[4] = (n % 2 == 1);
c[5] = c[6] = c[7] = c[8] = (n % 2 == 1);
c[9] = c[10] = c[11] = c[12] = (n - 2) / 2;
c[13] = c[14] = c[15] = c[16] = (n - 2) / 2;
c[17] = c[18] = c[19] = c[20] = (n - 2) / 2;
c[21] = c[22] = c[23] = c[24] = (n - 2) / 2 * (n % 2 == 1);
c[25] = c[26] = c[27] = c[28] = c[29] = c[30] = c[31] = c[32] = (c[9] - 1) * c[9] / 2;
int ans = 0, cnt, s0, s1;
#define calc_sum2(x, y) do { int k = sizeof(sq##x##y) / sizeof(sq##x##y[0]); s##y = 0; forn(i, k) { s##y += c[sq##x##y[i]]; } } while (0)
#define calc_sum(x) do { calc_sum2(x, 0); calc_sum2(x, 1); } while (0)
int n2 = (n+1)/2;
calc_sum(0);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
add(cnt, pow2(s0-n-n));
add(cnt, pow2(s0-n-n));
add(cnt, pow2(s0-n-n+1));
add(cnt, pow2(s0-n-n+1));
add(cnt, pow2(s0-n-n+1));
add(cnt, pow2(s0-n-n+1));
sub(cnt, pow2(s0-n-n-n+2));
sub(cnt, pow2(s0-n-n-n+2));
sub(cnt, pow2(s0-n-n-n+2));
sub(cnt, pow2(s0-n-n-n+2));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(1);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n2));
sub(cnt, pow2(s0-n2));
// add(cnt, pow2(s0-n));
add(cnt, pow2(s0-n2-n2));
add(cnt, pow2(s0-n-n2+1));
add(cnt, pow2(s0-n-n2+1));
// add(cnt, pow2(s0-n-n2+1));
// add(cnt, pow2(s0-n-n2+1));
// sub(cnt, pow2(s0-n-n2+1));
// sub(cnt, pow2(s0-n-n2+1));
sub(cnt, pow2(s0-n2-n2-n+2));
sub(cnt, pow2(s0-n2-n2-n+2));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(2);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n2));
sub(cnt, pow2(s0-n2));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
add(cnt, pow2(s0-n2-n2));
// add(cnt, pow2(s0-n));
add(cnt, pow2(n2-1));
add(cnt, pow2(n2-1));
// add(cnt, pow2(n2-1));
// add(cnt, pow2(n2-1));
// sub(cnt, pow2(n2-1));
// sub(cnt, pow2(n2-1));
sub(cnt, pow2(s0-n2-n2-n+2));
sub(cnt, pow2(s0-n2-n2-n+2));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(3);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(4);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(5);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(6);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(7);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
#undef calc_sum
#undef calc_sum2
ans = ans * (i64)r2[3] % MOD;
return ans;
}
i64 s_neq(int n, int m)
{
if (n > m) swap(n, m);
if (n == 1) return solve_one(m);
i64 c[25] = {};
c[0] = c[1] = c[2] = c[3] = 1;
c[4] = (n % 2 == 1) && (m % 2 == 1);
c[5] = c[6] = (m % 2 == 1);
c[7] = c[8] = (n % 2 == 1);
c[9] = c[10] = c[11] = c[12] = (m - 2) / 2;
c[13] = c[14] = c[15] = c[16] = (n - 2) / 2;
c[17] = c[18] = c[13] * (m % 2 == 1);
c[19] = c[20] = c[9] * (n % 2 == 1);
c[21] = c[22] = c[23] = c[24] = c[9] * c[13];
int ans = 0, cnt, s0, s1;
#define calc_sum2(x, y) do { int k = sizeof(nm##x##y) / sizeof(nm##x##y[0]); s##y = 0; forn(i, k) { s##y += c[nm##x##y[i]]; } } while (0)
#define calc_sum(x) do { calc_sum2(x, 0); calc_sum2(x, 1); } while (0)
int n2 = (n+1)/2;
int m2 = (m+1)/2;
calc_sum(0);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-m));
sub(cnt, pow2(s0-m));
add(cnt, pow2(s0-n-n));
add(cnt, pow2(s0-m-m));
add(cnt, pow2(s0-n-m+1));
add(cnt, pow2(s0-n-m+1));
add(cnt, pow2(s0-n-m+1));
add(cnt, pow2(s0-n-m+1));
sub(cnt, pow2(s0-n-n-m+2));
sub(cnt, pow2(s0-n-n-m+2));
sub(cnt, pow2(s0-m-m-n+2));
sub(cnt, pow2(s0-m-m-n+2));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(1);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-m2));
sub(cnt, pow2(s0-m2));
// add(cnt, pow2(s0-n));
add(cnt, pow2(s0-m2-m2));
add(cnt, pow2(s0-n-m2+1));
add(cnt, pow2(s0-n-m2+1));
// add(cnt, pow2(s0-n-m2+1));
// add(cnt, pow2(s0-n-m2+1));
// sub(cnt, pow2(s0-n-m2+1));
// sub(cnt, pow2(s0-n-m2+1));
sub(cnt, pow2(s0-m2-m2-n+2));
sub(cnt, pow2(s0-m2-m2-n+2));
// cerr << s0-m2-m2-n+2 << " == 0" << endl;
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(2);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n2));
sub(cnt, pow2(s0-n2));
sub(cnt, pow2(s0-m));
// sub(cnt, pow2(s0-m));
add(cnt, pow2(s0-n2-n2));
// add(cnt, pow2(s0-m));
add(cnt, pow2(n2-1));
add(cnt, pow2(n2-1));
// add(cnt, pow2(n2-1));
// add(cnt, pow2(n2-1));
// sub(cnt, pow2(n2-1));
// sub(cnt, pow2(n2-1));
sub(cnt, pow2(s0-n2-n2-m+2));
sub(cnt, pow2(s0-n2-n2-m+2));
// cerr << s0-n2-n2-m+2 << " == 0" << endl;
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
calc_sum(3);
cnt = 0;
add(cnt, pow2(s0));
sub(cnt, pow2(s0-n));
// sub(cnt, pow2(s0-n));
sub(cnt, pow2(s0-m));
// sub(cnt, pow2(s0-m));
// add(cnt, pow2(s0-n));
// add(cnt, pow2(s0-m));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// add(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
// sub(cnt, pow2(0));
add(cnt, pow2(0));
cnt = cnt * (i64)pow2(s1) % MOD;
ans = (ans + cnt) % MOD;
#undef calc_sum
#undef calc_sum2
ans = ans * (i64)r2[2] % MOD;
// ans = ans * (i64)mypow(4, MOD-2) % MOD;
return ans;
}
void precalc()
{
p2[0] = 1;
r2[0] = 1;
r2[1] = pow2(MOD - 2);
r2[2] = r2[1] * (i64)r2[1] % MOD;
r2[3] = r2[2] * (i64)r2[1] % MOD;
int ma = MAXN;
For(i, 1, MAXN * MAXN)
{
p2[i] = p2[i-1] * 2;
if (p2[i] >= MOD) p2[i] -= MOD;
}
clr(d);
clr(ds);
For(i, 1, ma)
{
For(j, 1, i)
{
if (i == j)
{
d[i][j] = s_eq(i);
}
else
{
d[i][j] = d[j][i] = s_neq(i, j);
}
}
}
For(i, 1, ma)
{
For(j, 1, i)
{
if (i != j)
{
ds[i][j] = ds[i-1][j];
add(ds[i][j], ds[i][j-1]);
sub(ds[i][j], ds[i-1][j-1]);
add(ds[i][j], d[i][j]);
}
else
{
ds[i][j] = ds[i-1][j];
add(ds[i][j], d[i][j]);
}
ds[j][i] = ds[i][j];
}
}
}
int main()
{
#ifdef ROOM_311
time_t et_0 = clock();
#endif
cout << setiosflags(ios::fixed) << setprecision(10);
precalc();
for(;;)
{
int n, m;
scanf("%d%d", &n, &m);
if (!n) break;
int z = ds[n][m];
printf("%d\n", z);
}
#ifdef ROOM_311
time_t et_1 = clock();
fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 39ms
memory: 15604kb
input:
2 2 2 3 0 0
output:
5 19
result:
ok 2 number(s): "5 19"
Test #2:
score: 0
Accepted
time: 67ms
memory: 15640kb
input:
468 935 11 14 759 366 329 132 927 952 305 636 666 273 136 820 269 289 792 591 876 779 482 929 545 476 475 77 774 657 696 788 912 159 806 982 280 872 293 6 443 378 373 561 397 22 76 133 607 524 795 879 565 1 789 2 128 689 34 301 648 879 371 785 20 69 638 620 295 572 783 274 106 884 338 738 240 281 69...
output:
535330097 953862294 255723183 829277098 844949331 15256975 550033130 64179493 223505424 591145428 149303387 738864186 393249151 471008468 408241932 775651606 745376308 304329933 764355580 569191996 340868773 9344920 147341035 77819150 109053854 541125316 15135811 821549969 677484940 372189128 606138...
result:
ok 100000 numbers
Test #3:
score: 0
Accepted
time: 58ms
memory: 15560kb
input:
873 534 892 255 973 848 295 638 141 290 979 722 587 751 995 69 474 128 226 730 320 433 628 733 787 269 502 966 493 783 889 294 403 672 672 743 410 331 142 77 842 406 244 980 660 348 41 542 904 72 949 505 111 672 327 144 363 717 87 850 608 452 608 746 276 403 391 463 895 124 822 265 472 334 21 676 25...
output:
22413224 754735501 150453092 361780502 674478077 135371408 639821479 668961747 523751779 121290213 471645920 879619642 730915878 847424596 829937680 108157461 658949463 361126557 114711051 607609477 109169582 467334628 899330298 651218786 917930944 282385029 184357245 958911451 199657100 728990713 2...
result:
ok 100000 numbers
Test #4:
score: 0
Accepted
time: 46ms
memory: 15648kb
input:
931 110 568 606 726 47 697 987 795 626 5 53 655 29 299 711 845 814 149 458 59 300 187 34 493 297 563 360 703 39 945 45 251 588 904 112 881 943 742 634 619 756 969 357 481 779 157 27 736 537 494 251 498 380 104 538 736 812 375 510 297 412 261 63 796 349 472 514 743 177 705 360 97 236 416 990 976 460 ...
output:
117662704 20817970 731770108 575712842 840429432 647693906 720055743 875884763 812916759 619520131 91133376 774502190 567916098 226669139 762842286 91540728 843902853 510752496 28401258 424188288 635528091 476333933 799503744 789557020 731578860 820054462 682705396 898478888 269097184 618202872 5440...
result:
ok 100000 numbers
Test #5:
score: 0
Accepted
time: 65ms
memory: 15640kb
input:
337 750 654 569 579 492 1 899 30 178 648 914 778 779 831 943 368 491 614 479 414 524 576 55 963 274 908 634 150 210 465 673 89 380 13 793 260 972 424 506 399 104 493 205 975 217 561 967 88 511 860 785 416 908 599 983 550 166 142 85 181 435 185 254 601 43 494 677 818 561 967 340 55 619 392 214 300 82...
output:
123604937 832950995 650575894 649389758 291597099 818862624 982932509 130936525 400848817 761033991 792471878 430607253 267102937 267199561 228963218 104588960 408996331 184082160 951943831 486234015 929949828 447891272 590847723 107136633 636709049 656862420 14305799 473345427 270617877 977642423 5...
result:
ok 100000 numbers
Test #6:
score: 0
Accepted
time: 57ms
memory: 15576kb
input:
386 710 391 914 326 799 289 764 964 180 404 861 224 14 983 538 58 63 123 227 484 596 69 112 692 764 295 525 618 10 521 5 67 206 870 435 492 200 980 852 114 980 241 811 67 214 283 593 721 609 281 482 405 73 957 558 411 7 909 894 247 680 393 24 337 786 360 892 978 233 100 827 612 357 21 660 614 569 28...
output:
464013736 883856911 994552435 54520345 560061750 815670638 426456204 88668217 143862687 728823722 698803324 111293527 465739237 446532581 329541516 417996149 126825792 11807240 627672104 274990165 587130200 732645026 853260001 629487641 839053394 927376854 59380326 227380022 481050817 54120909 24217...
result:
ok 100000 numbers
Test #7:
score: 0
Accepted
time: 62ms
memory: 15496kb
input:
927 396 953 166 35 137 573 760 763 249 499 446 179 327 153 250 566 109 281 65 9 382 899 734 663 891 149 445 44 376 47 119 735 857 515 485 211 430 430 395 794 803 944 21 354 750 777 171 317 867 698 695 161 383 210 531 397 460 483 943 52 195 665 199 324 260 6 326 838 992 622 922 746 772 34 229 898 833...
output:
539226883 591603678 525867443 553002480 348490312 101465019 227501826 183008864 927116848 811124636 829235901 26882574 821552854 133144182 817788693 210513062 271161333 77989257 895549118 80443598 918438995 353036779 992686927 112431964 574951306 498173770 139502096 634304905 12185314 624417698 5804...
result:
ok 100000 numbers
Test #8:
score: 0
Accepted
time: 74ms
memory: 15596kb
input:
329 395 171 15 947 764 498 283 632 31 697 50 582 217 895 856 701 788 848 899 229 128 701 87 810 789 400 672 219 568 539 307 943 285 368 963 530 858 243 853 422 960 360 82 262 2 404 547 490 784 95 770 154 437 718 568 755 628 34 721 934 2 468 880 255 338 367 255 879 457 98 625 137 660 392 889 189 836 ...
output:
440484078 516837852 585206675 911798201 447578365 149992175 355239470 318063661 433374556 96161447 176069814 591225877 700689224 707836396 956277134 740775967 458256920 941988881 770774203 515616423 364526428 84518500 62142290 473412504 131632804 309741392 977067389 573122215 551221831 840019202 383...
result:
ok 100000 numbers
Test #9:
score: 0
Accepted
time: 71ms
memory: 15640kb
input:
816 936 717 102 972 786 308 421 263 250 834 979 881 965 146 871 716 452 646 547 69 701 407 177 425 154 237 989 870 345 32 288 191 445 195 305 738 711 503 483 572 664 930 775 10 759 567 618 941 668 602 206 347 675 934 638 184 162 873 857 10 803 829 991 282 869 955 535 469 437 653 802 503 394 13 394 2...
output:
695540802 888498327 77041937 654054922 355022308 103179543 823899593 159665341 871897032 286819892 245465029 284366831 991182168 260542053 447446172 635298431 148372918 25452613 307422105 569819094 57751022 789824616 637027140 981417601 864330126 853529634 408771704 179628660 880802446 777360973 854...
result:
ok 100000 numbers
Test #10:
score: 0
Accepted
time: 58ms
memory: 15568kb
input:
18 101 714 38 520 793 753 986 585 449 361 815 719 59 842 985 521 182 239 149 582 29 807 595 971 420 390 800 948 678 571 990 49 58 46 459 212 131 148 425 508 442 329 139 294 794 297 921 318 879 380 242 44 438 993 691 129 573 24 19 67 26 845 585 394 318 660 774 987 460 827 907 16 22 790 505 693 560 36...
output:
816588354 767998260 436171024 507471738 991112879 411863361 44963746 292003598 290870402 241122068 773541143 945937493 46670178 624479415 62749865 120872644 94273358 835300967 862910662 363948022 401720909 12205324 190035138 132068573 232528975 568107488 96241429 564686790 669558181 767756440 916750...
result:
ok 100000 numbers
Test #11:
score: 0
Accepted
time: 64ms
memory: 15560kb
input:
892 928 139 616 565 993 631 825 2 93 47 532 748 311 877 536 660 774 282 672 93 308 13 347 217 533 730 513 575 971 413 987 995 240 346 314 416 222 742 558 544 721 277 827 767 834 221 228 25 108 516 938 824 958 418 471 718 865 560 94 112 329 279 668 47 124 524 151 328 781 761 651 9 65 28 655 888 768 8...
output:
48766367 667717208 159635975 540034366 860576854 477254917 119239022 122025104 342546531 750027379 450235143 912695287 331819035 555841033 721312047 621234773 809177345 681620158 521226056 262186879 611986954 342769441 50648125 248376524 645347490 124956059 522652526 293384252 5417720 610181516 8452...
result:
ok 100000 numbers
Test #12:
score: 0
Accepted
time: 71ms
memory: 15604kb
input:
961 599 758 199 873 11 890 336 550 621 113 973 569 23 502 673 715 470 992 475 165 276 382 690 182 884 700 538 616 475 548 644 50 586 154 541 415 828 35 871 100 731 304 267 635 953 234 652 754 183 915 195 545 979 156 73 565 823 593 495 908 203 856 185 502 389 638 643 253 609 655 994 119 981 373 914 9...
output:
976950253 269083211 542833338 602722143 964092268 755725834 194177339 327903008 884218308 812983084 71580343 363603158 863439068 440893806 110500640 124361451 83769245 333710268 890882954 129926325 406857589 869950438 476939530 38085332 794681583 977937471 797599292 862188207 137764940 739514171 851...
result:
ok 100000 numbers
Test #13:
score: 0
Accepted
time: 68ms
memory: 15432kb
input:
113 49 256 817 765 153 594 482 683 798 839 36 781 682 495 545 327 527 440 44 454 25 723 472 597 369 166 641 559 693 888 359 824 889 448 593 787 588 728 262 660 320 102 664 3 335 104 929 545 123 130 800 278 400 673 203 555 689 754 406 735 951 48 763 800 246 352 569 651 187 729 115 137 524 292 200 368...
output:
513507799 9871337 139119734 340288161 160135796 263920871 82629447 237469508 96579638 660969417 355113125 29504630 145348821 994156632 994287989 992452961 436063203 261965570 969024193 283405093 409102320 859729122 677748028 109052901 398950280 658784479 218367949 713512013 212201163 141888758 57337...
result:
ok 100000 numbers
Test #14:
score: 0
Accepted
time: 65ms
memory: 15540kb
input:
421 741 917 430 101 205 46 948 518 867 854 868 66 421 99 874 973 511 821 929 350 479 211 656 552 418 595 61 627 288 224 114 276 103 95 866 941 336 728 395 240 445 999 585 447 45 654 897 156 812 401 510 503 582 828 786 843 526 235 260 360 486 568 394 144 880 771 811 137 807 62 603 450 2 855 452 978 1...
output:
968240079 801283733 295861802 360092006 786658159 228903049 469679807 563237755 908030720 216448312 930229549 532447014 909763225 793057714 987455419 421972656 599050927 783787837 934025190 903136528 233359062 914944711 920805685 456593517 588570215 550714183 68079168 279594543 459623349 608724651 7...
result:
ok 100000 numbers
Test #15:
score: 0
Accepted
time: 116ms
memory: 15500kb
input:
885 751 939 45 640 192 660 979 873 131 54 409 648 939 737 246 233 741 183 722 704 686 695 85 161 324 845 882 287 850 759 331 219 773 835 161 311 588 565 457 20 578 432 835 650 532 64 963 321 511 963 157 986 100 604 272 256 400 358 5 671 284 445 238 72 18 362 937 554 496 760 311 530 562 469 765 768 2...
output:
133743425 504154884 585149384 602127905 363927413 212283916 311761061 604734545 726734499 830847548 79856530 991936310 222119534 333987181 886491313 80320532 735731677 369591209 971432182 170038906 488694630 842061637 120899145 625662449 534171098 692090321 986154007 529871341 6771157 410582009 6523...
result:
ok 100000 numbers
Test #16:
score: 0
Accepted
time: 126ms
memory: 15500kb
input:
762 795 45 705 841 820 98 903 818 671 917 996 679 718 428 709 168 87 914 595 310 757 423 502 574 48 120 625 927 293 322 925 371 753 46 76 94 451 131 449 984 72 658 191 278 271 697 723 68 732 621 102 939 40 798 962 426 83 700 918 1000 950 582 556 48 946 336 288 600 490 10 30 844 502 144 829 631 387 1...
output:
628343449 313525150 184748817 708732958 112410577 103024270 990813420 111517814 882104293 349628888 3883526 128272899 521627878 903662142 319901201 178151411 631376117 409894490 137340042 286199535 62367303 27564890 986764318 735878211 616799270 252103072 968027522 737855875 632892231 507952370 9225...
result:
ok 100000 numbers
Test #17:
score: 0
Accepted
time: 77ms
memory: 15528kb
input:
574 578 176 365 884 429 526 130 578 392 40 300 290 224 279 728 75 648 224 683 197 296 654 412 6 735 214 188 260 111 677 175 867 64 660 204 299 116 436 422 115 708 184 754 75 644 346 15 208 262 425 246 338 41 845 760 94 315 678 427 603 737 460 244 478 837 557 680 383 584 527 98 594 702 306 688 409 41...
output:
430699624 38963176 309871660 216725097 81520446 440442752 129416155 899300047 129347113 565573330 718438916 920464755 501777685 247193232 599387661 629847989 534063343 160175270 29795232 196286795 433087927 881886030 870062568 734749360 4180991 544882477 186047797 959134841 442494538 468086117 86169...
result:
ok 100000 numbers