QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65318#4584. Not OneSa3tElSefr#AC ✓423ms170784kbC++201.7kb2022-11-29 19:52:582022-11-29 19:53:00

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-29 19:53:00]
  • 评测
  • 测评结果:AC
  • 用时:423ms
  • 内存:170784kb
  • [2022-11-29 19:52:58]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double


const int N = 1e6 + 1, mod = 1e9 + 7;
int n, a[N];
bool prime[N];
vector<int> d[N], g[N];
unordered_map<int, int> dp[N];
int dfs(int node, int par, int gcd) {
    if(gcd != N && a[node] % gcd)
        return 0;
    if(dp[node].find(gcd) != dp[node].end())
        return dp[node][gcd];
    int &ans = dp[node][gcd];
    if(gcd == N) {
        for(auto i : g[node]) {
            if(i == par)
                continue;
            ans = max(ans, dfs(i, node, N));
        }
        for(auto j : d[a[node]]) {
            int cnt = 1;
            for(auto i : g[node]) {
                if(i == par)
                    continue;
                cnt += dfs(i, node, j);
            }
            ans = max(ans, cnt);
        }
    } else {
        ans = 1;
        for(auto i : g[node]) {
            if(i == par)
                continue;
            ans += dfs(i, node, gcd);
        }
    }
    return ans;
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    memset(prime, true, sizeof prime);
    for(int i = 2;i < N;i++) {
        if(!prime[i])
            continue;
        for(int j = i;j < N;j += i) {
            prime[j] = false;
            d[j].push_back(i);
        }
    }
    cin >> n;
    for(int i = 1;i <= n;i++)
        cin >> a[i];
    for(int i = 1;i < n;i++) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    cout << dfs(1, 1, N);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 289ms
memory: 139240kb

input:

7
10 5 8 6 10 6 4
1 2
2 3
2 4
4 5
4 6
4 7

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 271ms
memory: 138480kb

input:

4
1 1 1 1
1 2
2 3
3 4

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 248ms
memory: 138292kb

input:

5
100 100 100 100 100
3 4
1 2
3 5
2 4

output:

5

result:

ok single line: '5'

Test #4:

score: 0
Accepted
time: 262ms
memory: 137996kb

input:

2
1 1
1 2

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 376ms
memory: 158660kb

input:

100000
860163 795323 862289 543383 792647 337047 353985 959953 874318 573652 69827 958063 571741 704399 311826 920477 792478 151531 872269 592307 853819 865817 940735 620657 937154 696551 749279 552523 836161 707467 389626 459089 563763 668884 810391 639709 419361 580342 519595 836124 494959 669379 ...

output:

213

result:

ok single line: '213'

Test #6:

score: 0
Accepted
time: 355ms
memory: 157116kb

input:

100000
999983 999983 999961 999961 999979 999979 999979 999961 999983 999961 999979 999961 999961 999983 999961 999983 999983 999979 999961 999979 999983 999979 999983 999961 999979 999961 999979 999979 999961 999979 999983 999979 999961 999961 999961 999961 999961 999983 999979 999983 999979 999961...

output:

70

result:

ok single line: '70'

Test #7:

score: 0
Accepted
time: 369ms
memory: 160244kb

input:

100000
721703 392879 695588 695588 360569 721703 721703 721703 392879 721703 521691 173897 173897 31699 605629 330661 521691 887572 869485 721703 538883 633980 347794 721703 173897 524464 380388 983370 330661 196674 982669 327790 392879 721703 557243 347794 65558 163895 31699 521691 392879 426127 22...

output:

23467

result:

ok single line: '23467'

Test #8:

score: 0
Accepted
time: 388ms
memory: 159412kb

input:

100000
999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983 999983...

output:

100000

result:

ok single line: '100000'

Test #9:

score: 0
Accepted
time: 287ms
memory: 144404kb

input:

16666
499521 566687 918452 827210 997739 405921 930466 453499 449367 302663 658220 713125 615536 484783 586258 469620 984395 526320 799319 849099 284114 723734 22671 661826 325985 662335 107207 564634 836931 323058 117954 661326 658962 599495 103335 377185 45338 385027 50770 961843 691799 693591 281...

output:

13

result:

ok single line: '13'

Test #10:

score: 0
Accepted
time: 356ms
memory: 160196kb

input:

66666
10 6 90 60 15 150 90 10 150 12 30 10 12 150 15 50 6 60 60 150 50 50 50 30 10 45 150 6 6 90 50 6 30 12 90 6 60 15 90 45 6 90 45 45 10 60 150 30 30 6 90 12 30 30 6 60 12 45 50 60 45 50 50 50 12 60 10 50 30 150 15 150 90 10 10 12 10 30 6 60 45 6 6 60 12 12 45 12 12 45 12 60 30 30 150 90 6 150 6 6...

output:

46

result:

ok single line: '46'

Test #11:

score: 0
Accepted
time: 321ms
memory: 146912kb

input:

28571
921969 307323 580499 751234 102441 648793 743442 68294 955092 600043 568071 610323 614646 102441 136588 962429 307588 239029 990263 170735 50247 221505 614646 232539 102441 424891 682940 102441 682940 887822 424891 239029 849782 68294 819528 850736 751234 375617 400566 34147 768051 341470 1024...

output:

12698

result:

ok single line: '12698'

Test #12:

score: 0
Accepted
time: 407ms
memory: 157812kb

input:

99415
34616 810608 192350 394543 662841 466264 344614 520619 330891 310932 733902 352703 158039 846731 479629 7807 614728 918662 549561 535798 416048 953051 388610 112163 192506 610550 328203 268293 117567 49639 485945 159856 235364 42325 438801 140386 658755 181970 11852 602321 688908 569920 8816 1...

output:

76

result:

ok single line: '76'

Test #13:

score: 0
Accepted
time: 374ms
memory: 157524kb

input:

100000
280401 761952 441017 796661 314679 435234 485202 937046 696099 625259 759522 701907 631073 602136 209475 52398 548659 494159 499651 614433 138272 622721 61832 606399 466753 468859 572846 371879 766454 93732 607153 230056 390233 203061 609095 889707 266382 543672 616447 159597 211647 597406 14...

output:

11067

result:

ok single line: '11067'

Test #14:

score: 0
Accepted
time: 342ms
memory: 157424kb

input:

93769
849132 451689 130007 436266 701702 236258 740041 423243 934674 413025 770289 426117 465372 974372 315378 228808 858754 236739 725646 533859 789429 269744 152988 160376 426030 801877 82477 507774 383870 776467 894274 928966 699962 309984 294875 605422 9606 445815 776629 262295 735221 617452 411...

output:

46

result:

ok single line: '46'

Test #15:

score: 0
Accepted
time: 254ms
memory: 138236kb

input:

2
1 1024
1 2

output:

1

result:

ok single line: '1'

Test #16:

score: 0
Accepted
time: 368ms
memory: 159732kb

input:

100000
120852 825140 516610 899113 975662 453827 330056 866397 948911 297136 473132 990168 177130 371313 783883 124011 907654 495084 731464 41257 41257 753003 707558 844537 660071 165028 304667 531677 577598 119855 290373 596276 121277 371313 905373 883081 907654 495084 748418 706876 846224 330056 7...

output:

48533

result:

ok single line: '48533'

Test #17:

score: 0
Accepted
time: 372ms
memory: 157476kb

input:

98009
284468 17931 239807 444092 600837 657074 930923 177485 797784 131995 163891 157027 861065 755264 307617 693497 948352 497591 775007 917410 440702 980575 599253 934052 367374 316218 968786 562064 828573 645765 178229 519001 552926 145657 448468 606983 94874 797231 398073 362019 917024 457439 10...

output:

17

result:

ok single line: '17'

Test #18:

score: 0
Accepted
time: 423ms
memory: 159148kb

input:

100000
605131 31849 624816 636980 700678 394807 127396 218640 318490 337430 725037 254792 318490 610305 445886 789614 159245 859923 445886 636980 573282 710019 286641 400445 940163 923621 353112 764376 580433 636980 733213 573282 700678 808165 846015 217463 764376 952758 254792 891772 159245 350339 ...

output:

48014

result:

ok single line: '48014'

Test #19:

score: 0
Accepted
time: 339ms
memory: 156692kb

input:

91139
688753 762129 758881 95826 183968 661949 934118 608838 169928 119627 594829 147490 356787 857384 754661 603417 460695 368970 631753 508848 751838 446058 990793 248660 644624 668725 379802 814955 280476 295208 497117 986965 387186 206451 22867 386355 969750 722994 174613 562047 621884 13385 388...

output:

526

result:

ok single line: '526'

Test #20:

score: 0
Accepted
time: 353ms
memory: 159224kb

input:

100000
944429 816188 148436 823699 335381 851913 295755 78192 690527 253593 43616 399809 446285 341239 103268 557240 760788 831472 415193 681060 848138 687021 192137 34053 968673 737815 751093 805387 419647 449895 707019 18518 278774 367941 613569 56755 363232 113573 691606 545959 556801 836593 7117...

output:

10224

result:

ok single line: '10224'

Test #21:

score: 0
Accepted
time: 393ms
memory: 156880kb

input:

92177
434341 827567 843170 499390 493475 462527 706334 578546 626502 698298 942080 520272 227126 488718 647916 917815 15556 983529 763988 309348 887259 735859 120533 555985 269320 253817 512123 754114 656092 177708 616202 348417 231644 972582 92321 786325 985179 608244 948496 772530 271979 298199 30...

output:

42

result:

ok single line: '42'

Test #22:

score: 0
Accepted
time: 349ms
memory: 160108kb

input:

100000
957094 342749 31159 93477 342749 500690 685498 774288 249272 124636 450621 405067 186954 903611 778975 815736 687564 592021 747816 544538 436226 422632 416405 705601 480158 239091 685498 677052 592021 745569 93477 685498 218113 716657 349888 281386 304605 857491 452700 623180 251126 808630 68...

output:

49287

result:

ok single line: '49287'

Test #23:

score: 0
Accepted
time: 388ms
memory: 156368kb

input:

96039
174893 186480 549394 773691 997136 9366 76386 826179 939201 453515 821985 682108 496373 128318 782886 232322 928809 587487 665747 499538 994330 921665 605467 385743 17117 924293 982891 63379 710043 628523 302111 270887 373923 601054 845102 749082 46375 310152 289835 47739 675826 530063 295093 ...

output:

22

result:

ok single line: '22'

Test #24:

score: 0
Accepted
time: 379ms
memory: 159460kb

input:

100000
289617 291030 135879 362354 644449 782066 646881 27982 271758 746090 99325 415162 769981 279460 951153 226465 537047 337720 813180 331298 948037 897560 29590 739944 165624 362344 910926 426785 244394 138498 406760 768206 679395 553747 627830 751237 430109 608203 267590 377769 194744 104365 15...

output:

17588

result:

ok single line: '17588'

Test #25:

score: 0
Accepted
time: 370ms
memory: 158396kb

input:

97700
89592 612148 883209 853656 714890 804351 980758 793492 879022 287900 660860 821166 996539 275494 93619 539264 539668 730533 700446 609319 962458 871158 627738 542615 801456 682107 77102 671702 898620 665019 593712 68666 259889 956880 344569 629474 67155 72423 380137 369709 339846 929750 405376...

output:

1011

result:

ok single line: '1011'

Test #26:

score: 0
Accepted
time: 280ms
memory: 138680kb

input:

2
59049 1024
1 2

output:

1

result:

ok single line: '1'

Test #27:

score: 0
Accepted
time: 402ms
memory: 157168kb

input:

100000
709950 601976 329118 617814 917962 152158 694718 880863 472002 292511 214367 320025 849332 937007 44285 121785 791572 645962 795252 967873 817188 176276 676483 986084 923534 660941 536414 175919 224559 906711 718085 192646 355414 962997 429393 719857 658148 42157 967355 177897 455646 829551 6...

output:

924

result:

ok single line: '924'

Test #28:

score: 0
Accepted
time: 366ms
memory: 157076kb

input:

90047
419622 425374 640251 389296 28930 237426 851936 980277 993601 861287 538564 131803 43273 748420 302662 871665 120360 538465 984517 947330 262166 289658 784027 282128 944120 649801 870799 520797 636417 470932 739177 251514 775226 40740 201742 966416 155327 852255 837151 754400 170707 4134 29509...

output:

169

result:

ok single line: '169'

Test #29:

score: 0
Accepted
time: 378ms
memory: 159972kb

input:

100000
788843 615838 771453 93362 921807 580397 46681 990089 793577 858987 933620 102423 513491 529543 559375 663050 258707 933620 186724 336866 34141 685774 365665 136564 186724 659900 273128 554130 99953 733457 203503 532927 238987 186724 990089 273128 746896 746896 12935 238987 307269 934443 7979...

output:

43194

result:

ok single line: '43194'

Test #30:

score: 0
Accepted
time: 372ms
memory: 157636kb

input:

99228
434825 798006 534314 487362 333899 250435 628633 387188 789430 812801 426629 495309 396626 562416 659696 982951 421507 2336 708966 88642 136211 54386 626942 76226 496580 711315 576141 570987 803469 262817 195551 478337 275076 671258 770839 952112 795386 352463 584733 402627 921164 616678 13825...

output:

26

result:

ok single line: '26'

Test #31:

score: 0
Accepted
time: 380ms
memory: 159824kb

input:

100000
951170 330121 827407 840308 898809 751972 953436 990363 938601 122172 125577 121101 807521 113311 583607 305144 300110 260093 300110 759021 50823 281631 752505 852697 270099 389643 870319 999204 33483 500209 546860 180066 116241 663334 48560 381365 705875 150478 138399 961883 30011 33165 1662...

output:

18932

result:

ok single line: '18932'

Test #32:

score: 0
Accepted
time: 357ms
memory: 158028kb

input:

96147
156638 17198 448094 388352 732162 419299 871265 494427 944505 779709 98219 619152 675305 22031 620475 32628 44794 907582 214344 567450 4289 239132 489531 522330 414184 814919 213424 931613 417827 922974 830703 508256 885364 95979 992580 523850 842165 328748 645317 926142 139952 538875 49059 89...

output:

4038

result:

ok single line: '4038'

Test #33:

score: 0
Accepted
time: 355ms
memory: 159604kb

input:

100000
555209 409072 113268 579409 896082 530650 76792 97710 555556 344559 423314 236705 129571 462994 93550 120281 829436 920199 984944 4972 321372 58258 533689 75876 752142 276908 169608 343835 132636 798281 219780 177419 81877 894338 958067 308179 991484 912760 776918 431077 984885 807495 532990 ...

output:

6509

result:

ok single line: '6509'

Test #34:

score: 0
Accepted
time: 371ms
memory: 159184kb

input:

99418
606627 561433 934271 185645 394008 454676 146064 139742 88825 501760 164440 728032 252764 794858 85944 700409 710060 835089 575094 212001 399982 257596 664478 762021 745110 101863 480704 94810 110078 921511 123541 973946 62767 125962 963341 13774 580817 246410 451750 435200 415445 918022 36720...

output:

186

result:

ok single line: '186'

Test #35:

score: 0
Accepted
time: 351ms
memory: 161064kb

input:

100000
635649 911576 674965 15923 264806 618937 675204 302690 514573 938339 281335 346177 605380 30059 726456 423766 817263 90807 506403 994258 635649 437545 246987 593561 709087 423766 147266 877801 708434 419998 67898 936832 122026 168801 562670 60538 793547 900272 484304 562670 886501 362572 3175...

output:

36433

result:

ok single line: '36433'

Test #36:

score: 0
Accepted
time: 350ms
memory: 157668kb

input:

99652
326033 941991 893364 912158 714400 786565 961195 132850 329759 72273 225029 941910 627900 284586 51172 525419 687066 752273 116305 168628 954593 326826 73379 590219 764580 621959 27651 227483 128084 613241 439233 611663 515275 300233 516566 497340 609189 679712 611084 627805 579265 619733 3107...

output:

41

result:

ok single line: '41'

Test #37:

score: 0
Accepted
time: 263ms
memory: 138132kb

input:

2
490058 735087
1 2

output:

2

result:

ok single line: '2'

Test #38:

score: 0
Accepted
time: 394ms
memory: 160280kb

input:

100000
904509 463990 982396 631592 401584 711270 518485 231995 92225 373373 754652 228012 632664 835182 788783 268576 417591 881581 510389 753108 448171 12802 576696 510389 324793 743789 817383 185596 695985 92798 463990 974379 742384 619225 713778 417591 334921 463990 258094 155692 927980 927980 32...

output:

36526

result:

ok single line: '36526'

Test #39:

score: 0
Accepted
time: 399ms
memory: 161876kb

input:

100000
497664 893293 659016 708325 762561 245482 956781 574671 665750 12110 280706 25529 124798 229956 662482 16974 107137 314008 770744 507624 454482 284424 257466 256048 416016 580924 968588 327962 861209 702097 27508 92720 28720 589177 818758 442410 297429 927304 509051 495523 816695 628016 61873...

output:

49842

result:

ok single line: '49842'

Test #40:

score: 0
Accepted
time: 390ms
memory: 157128kb

input:

100000
402831 358867 77210 580126 981626 593595 917738 614200 923913 144052 839905 494032 317493 60279 571737 402209 811117 270579 565221 805480 347699 806487 10027 856825 144853 779464 919479 990775 15661 344226 687014 435393 963525 411203 130183 857595 851327 630488 688112 966380 301986 873932 619...

output:

25779

result:

ok single line: '25779'

Test #41:

score: 0
Accepted
time: 359ms
memory: 158448kb

input:

92817
877250 587585 124155 3480 773565 650989 72038 769078 954685 754152 431707 739173 564252 481983 727657 859436 953469 615358 472620 312394 134459 455945 182292 725041 811934 275183 897098 982763 194155 241552 552747 595766 978703 564208 664346 635014 865773 726607 134332 600441 846764 774617 781...

output:

36

result:

ok single line: '36'

Test #42:

score: 0
Accepted
time: 384ms
memory: 161300kb

input:

100000
438799 736222 340164 781656 987650 484192 172947 515981 665416 363144 799396 562215 787317 482520 422411 875506 387650 399341 703069 390783 337971 471377 560663 635502 41554 359091 633307 317025 205398 516221 738007 277842 645499 589624 535116 211373 213326 548841 494677 711157 257107 509377 ...

output:

6474

result:

ok single line: '6474'

Test #43:

score: 0
Accepted
time: 381ms
memory: 159172kb

input:

92529
628356 630924 40417 334874 764929 687140 664136 324763 538481 505352 516620 622023 917441 374161 867111 998458 635362 548853 479451 22478 431238 66663 319892 745810 430236 365028 905903 584395 527177 142637 351032 740251 875787 554403 562649 260733 642065 641578 208598 158738 352222 839132 293...

output:

32

result:

ok single line: '32'

Test #44:

score: 0
Accepted
time: 380ms
memory: 159924kb

input:

100000
385432 743313 774373 249593 77580 599913 766006 793913 749422 798014 285546 654456 516194 424774 935878 790614 968434 379563 890063 635375 781895 213880 527809 985751 386395 997687 182046 527809 546138 96358 185267 529969 377237 331683 538621 54138 527809 210084 527809 527809 118085 426941 52...

output:

9960

result:

ok single line: '9960'

Test #45:

score: 0
Accepted
time: 372ms
memory: 157452kb

input:

90482
826529 36363 391756 323355 155660 355368 316776 795794 341497 274956 347250 999714 59769 10740 879818 813003 471346 227305 397085 274711 679823 672578 985176 19349 673239 443978 150366 797425 687717 834201 141369 440667 553375 17139 310178 371546 564119 92142 649690 228355 15921 357781 236188 ...

output:

31

result:

ok single line: '31'

Test #46:

score: 0
Accepted
time: 386ms
memory: 159800kb

input:

100000
181500 17666 314929 398395 828780 580772 591389 831478 545682 144688 29623 309565 790815 767142 433550 924484 677924 475268 409192 798418 951174 843508 233682 77503 444271 377241 930678 630330 632040 745877 693041 878886 911869 808090 671790 869768 923217 693041 379371 63168 111566 635113 233...

output:

5964

result:

ok single line: '5964'

Test #47:

score: 0
Accepted
time: 328ms
memory: 151756kb

input:

70107
18 38 29 87 21 14 36 37 80 87 49 2 95 50 66 67 97 87 27 4 60 2 88 6 35 26 27 47 40 52 90 31 10 79 64 11 21 37 69 5 74 33 96 29 18 67 51 39 67 77 50 67 84 50 2 19 17 23 40 25 47 83 60 16 84 80 20 83 42 90 78 38 36 72 57 80 86 34 66 64 91 21 26 37 70 35 92 47 78 48 80 25 38 22 61 50 64 92 25 69 ...

output:

59

result:

ok single line: '59'

Test #48:

score: 0
Accepted
time: 267ms
memory: 138948kb

input:

3
18 100 245
1 2
2 3

output:

2

result:

ok single line: '2'

Test #49:

score: 0
Accepted
time: 309ms
memory: 151304kb

input:

58992
389532 629707 806337 829252 510995 499834 90522 923060 886078 892723 921194 825804 901382 987165 716409 423106 503661 328226 863012 906369 154343 314484 219089 798782 837410 528926 507762 637507 732367 944958 266779 590316 701446 117816 519464 808549 223374 271567 639999 103470 519124 578883 1...

output:

8171

result:

ok single line: '8171'

Test #50:

score: 0
Accepted
time: 388ms
memory: 160160kb

input:

100000
129188 904316 656932 918380 853958 713294 678237 904316 161485 484162 614709 32297 444249 290673 991479 421467 663698 60712 170865 583467 967265 490110 348384 212492 804434 371562 570269 60712 913554 452158 506759 565753 136602 814160 804434 725227 509590 922496 105585 645940 842379 371861 22...

output:

18382

result:

ok single line: '18382'

Test #51:

score: 0
Accepted
time: 394ms
memory: 157020kb

input:

100000
631 38 59 264 96 582 817 181 629 59 851 902 371 424 315 868 723 565 138 767 489 858 7 203 115 427 549 738 90 98 271 32 446 304 114 664 974 695 629 166 214 948 883 722 450 656 700 553 99 571 183 928 558 297 44 319 11 66 101 379 658 211 972 321 281 905 410 136 917 955 326 607 183 745 42 55 457 ...

output:

320

result:

ok single line: '320'

Test #52:

score: 0
Accepted
time: 373ms
memory: 158900kb

input:

100000
771655 904644 698502 970825 525620 998675 584919 944615 795576 504314 896722 676782 646730 655226 933691 926401 706206 572479 590332 892586 749066 908806 969189 639727 788679 775478 790955 636124 666554 764950 711405 954659 846981 766290 975858 550908 800139 548084 988904 943924 951593 875939...

output:

10300

result:

ok single line: '10300'

Test #53:

score: 0
Accepted
time: 368ms
memory: 156896kb

input:

100000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0

result:

ok single line: '0'

Test #54:

score: 0
Accepted
time: 329ms
memory: 156892kb

input:

100000
229373 376237 365147 178603 908581 679537 892421 654623 324319 237911 513269 336247 390077 376819 470903 163363 207433 506351 217793 717091 940169 310423 783647 79561 384487 255667 453379 950879 371719 280771 738707 551519 935021 780397 528719 434501 638923 861853 264331 115963 587087 728417 ...

output:

1

result:

ok single line: '1'

Test #55:

score: 0
Accepted
time: 386ms
memory: 161608kb

input:

100000
610454 95135 534558 653490 541395 474827 285829 564768 132659 279946 594872 601020 329713 209615 646759 871161 502387 570121 695572 584219 617132 30316 367290 78599 292613 521043 895700 23744 917960 981772 907572 517598 761292 545052 395857 305492 576322 810052 325049 997778 203573 829874 135...

output:

100000

result:

ok single line: '100000'

Test #56:

score: 0
Accepted
time: 396ms
memory: 160500kb

input:

100000
147612 442836 811866 12301 971779 897973 455137 627351 123010 799565 405933 123010 110709 319826 701157 344428 307525 922575 332127 996381 910274 947177 455137 12301 381331 934876 922575 836468 123010 615050 73806 455137 246020 86107 516642 159913 934876 61505 996381 934876 627351 688856 5904...

output:

100000

result:

ok single line: '100000'

Test #57:

score: 0
Accepted
time: 400ms
memory: 159380kb

input:

100000
94282 39215 246013 26939 672695 56287 121693 396865 46905 49445 81673 95410 329251 68635 62651 92167 218569 326155 804593 219678 128699 996353 349338 58406 119239 430559 51901 57505 363341 303807 810078 770385 40467 38019 230945 274183 36941 21359 674531 89981 172753 520590 387562 244283 4603...

output:

43

result:

ok single line: '43'

Test #58:

score: 0
Accepted
time: 412ms
memory: 170784kb

input:

100000
881790 780045 190190 177905 746130 646323 43890 672945 255255 72930 206074 51051 176358 51870 782782 149226 646646 51870 98670 570570 903210 746130 51870 72930 969969 53130 138890 102102 170170 62985 114114 930930 336490 102102 72930 836418 67830 510510 201894 397670 746130 36465 903210 31201...

output:

11494

result:

ok single line: '11494'

Test #59:

score: 0
Accepted
time: 263ms
memory: 139424kb

input:

30
140098 902545 990693 470329 359520 650455 330231 666717 670469 950665 222346 616962 149693 320224 610427 570399 210147 260182 60241 950665 200140 99296 750525 580406 340238 437095 160112 620434 681804 210147
17 18
3 17
22 26
16 30
4 28
5 29
8 19
5 26
7 15
11 13
20 25
1 25
10 16
14 25
4 18
18 27
1...

output:

20

result:

ok single line: '20'

Test #60:

score: 0
Accepted
time: 381ms
memory: 165220kb

input:

100000
777600 810000 900000 648000 900000 729000 729000 900000 540000 972000 540000 972000 972000 607500 622080 810000 972000 607500 648000 810000 720000 729000 675000 984150 583200 720000 583200 524880 729000 864000 810000 607500 729000 729000 675000 607500 607500 691200 972000 937500 648000 540000...

output:

98698

result:

ok single line: '98698'

Test #61:

score: 0
Accepted
time: 359ms
memory: 158852kb

input:

100000
8321 23746 66508 57909 46714 34899 41314 32954 34320 97712 96138 67769 33921 40531 67218 44942 89358 82394 48209 55047 42116 94517 16123 31039 35992 10410 18137 16829 35145 52853 42282 51053 13191 14798 51934 6454 34777 79079 31768 74610 43369 54980 20241 25010 42436 62478 17773 89116 17368 2...

output:

535

result:

ok single line: '535'

Test #62:

score: 0
Accepted
time: 379ms
memory: 164428kb

input:

100000
11738 93273 88701 707781 171278 317314 507477 372579 575007 311138 555326 570578 535454 445202 376702 310533 261039 784929 520838 479174 266451 720789 36213 507981 679227 399206 774093 124437 560606 467223 557439 241246 471566 300147 727557 798279 200289 264734 409358 231746 590883 781359 530...

output:

3

result:

ok single line: '3'

Test #63:

score: 0
Accepted
time: 353ms
memory: 167096kb

input:

100000
831189 629819 986519 562043 878516 339265 553544 445114 759298 158374 399447 636154 277613 820177 926659 879113 935423 537063 223151 761612 373139 605918 427789 867881 766021 990141 202873 594749 822792 359132 847601 502081 773933 310127 456767 485833 700012 638159 692764 517751 847531 604971...

output:

14

result:

ok single line: '14'

Test #64:

score: 0
Accepted
time: 338ms
memory: 157856kb

input:

100000
529649 887669 727747 221797 559973 899488 364351 979921 618671 47221 345963 25642 568472 775987 353553 813674 539899 361789 734653 821741 897669 856519 951787 781951 686041 745397 203956 874142 976817 333974 860107 656666 721863 773497 808937 569991 656427 883451 980921 481790 923233 239138 2...

output:

131

result:

ok single line: '131'