QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#774394 | #9787. Shrek's Song of the Swamp | ucup-team1004# | AC ✓ | 233ms | 57152kb | C++20 | 1.5kb | 2024-11-23 13:11:54 | 2024-11-23 13:11:56 |
Judging History
answer
#include<bits/stdc++.h>
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define eb emplace_back
#define all(x) x.begin(),x.end()
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;
const int N=1e6+5,M=N*4+5,K=1000+5,mod=998244353,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(28382);
#define Tp template<typename T>
#define Ts template<typename T,typename... Ar>
namespace Debug{
Tp void _debug(char* f,T t){cerr<<f<<'='<<t<<endl;}
Ts void _debug(char* f,T x,Ar... y){while(*f!=',') cerr<<*f++;cerr<<'='<<x<<",";_debug(f+1,y...);}
#ifdef LOCAL
#define gdb(...) _debug((char*)#__VA_ARGS__,__VA_ARGS__)
#else
#define gdb(...) void()
#endif
}using namespace Debug;
int n,pre[N],A[N],dp[N];
void Solve(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&A[i]);
unordered_map<int,int> f;
for(int i=n;i;i--){
if(f.count(A[i])) pre[i]=f[A[i]];
f[A[i]]=i;
}
Me(dp,-0x3f);
int mx=0;
for(int i=1;i<=n;i++){
if(pre[i]) dp[pre[i]]=max(max(dp[i]+1,mx+2),dp[pre[i]]);
mx=max(mx,dp[i]);
}
printf("%d\n",mx);
}
int main(){
int t=1;
// scanf("%d",&t);
while(t--) Solve();
cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 11188kb
input:
9 1 2 3 1 3 1 2 3 2
output:
5
result:
ok 1 number(s): "5"
Test #2:
score: 0
Accepted
time: 1ms
memory: 8040kb
input:
6 3 4 10 1 -3 5
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 2ms
memory: 11124kb
input:
4 1 2 1 1
output:
3
result:
ok 1 number(s): "3"
Test #4:
score: 0
Accepted
time: 0ms
memory: 10236kb
input:
9 1 2 3 1 3 1 2 3 2
output:
5
result:
ok 1 number(s): "5"
Test #5:
score: 0
Accepted
time: 1ms
memory: 9132kb
input:
6 3 4 10 1 -3 5
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 0ms
memory: 10780kb
input:
4 1 2 1 1
output:
3
result:
ok 1 number(s): "3"
Test #7:
score: 0
Accepted
time: 52ms
memory: 15724kb
input:
1000000 7 2 6 10 3 1 9 3 5 3 8 10 8 4 10 1 9 5 2 7 9 7 10 4 5 2 10 9 6 3 6 10 5 2 9 3 4 6 6 10 10 6 1 9 4 5 7 2 2 10 2 8 5 6 1 8 3 9 1 8 1 6 6 1 4 9 3 8 1 4 10 10 7 4 9 8 7 1 9 1 5 5 6 5 5 6 7 4 10 6 1 6 10 6 7 8 1 9 1 9 10 3 2 5 2 3 9 2 9 4 8 4 8 9 2 6 8 4 5 3 3 3 2 6 8 10 2 10 2 4 10 10 10 7 1 3 2...
output:
463867
result:
ok 1 number(s): "463867"
Test #8:
score: 0
Accepted
time: 52ms
memory: 15868kb
input:
1000000 5 3 10 9 1 5 5 1 5 6 6 8 5 9 4 5 8 1 10 3 4 2 1 7 2 8 6 5 1 3 8 7 3 3 5 9 7 8 8 10 8 5 7 9 2 8 5 6 6 8 10 3 4 1 4 8 10 4 10 10 7 3 9 4 9 4 2 1 6 1 9 7 5 1 8 8 6 4 5 9 9 8 2 7 5 9 10 6 9 3 4 8 4 7 10 9 1 3 9 7 1 2 7 9 10 1 8 6 10 7 9 5 8 2 8 7 6 5 9 9 4 2 3 7 6 8 6 10 8 9 4 3 1 10 3 5 2 3 4 5...
output:
463719
result:
ok 1 number(s): "463719"
Test #9:
score: 0
Accepted
time: 52ms
memory: 15684kb
input:
1000000 2 4 4 8 5 4 2 7 4 6 3 9 10 9 1 1 2 7 5 3 8 10 6 2 2 7 5 6 2 6 2 2 5 3 10 6 2 1 2 4 7 5 8 2 1 4 10 9 10 8 10 4 6 7 2 5 4 6 2 6 3 10 6 5 8 8 1 8 2 1 7 6 5 1 6 1 7 6 6 1 1 8 4 8 9 10 7 5 10 10 5 1 10 6 2 2 3 6 3 9 5 3 7 5 1 4 1 7 5 6 4 1 4 9 2 3 8 2 4 10 1 9 6 9 4 5 8 3 2 6 5 5 6 6 7 10 6 9 4 9...
output:
463645
result:
ok 1 number(s): "463645"
Test #10:
score: 0
Accepted
time: 53ms
memory: 15728kb
input:
1000000 7 10 10 7 8 8 4 7 1 2 9 5 7 10 2 2 6 3 3 5 7 6 4 4 9 2 1 8 6 4 4 9 1 8 1 8 10 10 4 5 5 5 4 10 4 10 4 10 4 4 7 8 6 4 6 4 2 4 1 8 1 3 1 4 10 5 6 3 5 5 5 8 4 4 4 10 3 4 6 3 1 1 10 6 8 10 10 3 6 9 5 9 7 10 2 3 7 10 2 6 6 3 4 6 5 8 2 1 3 8 6 2 2 9 5 2 9 8 4 10 10 3 10 4 2 2 7 2 1 1 1 10 6 3 6 5 6...
output:
463052
result:
ok 1 number(s): "463052"
Test #11:
score: 0
Accepted
time: 48ms
memory: 15708kb
input:
1000000 2 8 8 5 5 3 6 1 8 5 10 1 3 1 6 10 10 3 2 3 10 6 3 2 3 5 7 3 10 9 2 3 8 1 1 10 3 6 1 3 10 1 7 2 4 3 6 8 1 5 8 7 9 5 2 6 5 4 8 4 5 10 1 4 8 1 7 10 1 9 8 5 7 3 7 4 9 1 1 10 8 8 8 8 5 3 4 8 1 10 9 5 1 2 3 10 5 10 2 6 1 1 5 1 6 3 10 4 4 2 8 6 1 10 7 4 7 5 8 6 3 8 4 1 7 9 8 4 2 8 8 10 5 5 6 10 2 1...
output:
463178
result:
ok 1 number(s): "463178"
Test #12:
score: 0
Accepted
time: 47ms
memory: 15836kb
input:
1000000 4 2 4 6 7 7 9 5 9 5 5 7 3 7 1 9 2 6 5 9 5 8 8 1 5 5 7 7 8 9 6 6 3 2 3 2 2 4 5 6 9 8 10 10 6 7 2 4 3 4 3 8 2 6 3 2 9 7 3 3 6 4 4 10 10 2 3 4 7 5 4 8 2 1 8 7 8 7 8 1 2 10 8 1 3 3 2 6 2 7 7 9 9 10 2 6 7 7 7 5 1 9 2 7 2 4 2 7 2 3 10 8 7 2 7 8 4 7 8 8 6 1 5 9 2 9 5 4 3 6 4 7 4 8 3 5 7 1 7 5 2 2 2...
output:
463207
result:
ok 1 number(s): "463207"
Test #13:
score: 0
Accepted
time: 48ms
memory: 15872kb
input:
1000000 10 1 7 7 10 2 9 8 6 1 6 7 3 4 10 1 7 6 9 9 9 5 6 1 2 2 1 8 9 2 2 2 9 5 4 4 1 3 3 9 7 8 2 2 2 4 2 7 1 7 9 4 8 6 5 7 4 1 7 5 1 5 9 4 5 4 3 3 5 9 5 3 9 4 6 4 4 5 3 2 2 9 3 8 5 2 5 9 7 3 9 10 7 4 3 5 2 6 8 7 6 9 2 4 1 4 5 6 2 4 3 10 1 8 8 7 7 4 2 3 7 2 6 1 10 6 3 9 1 4 5 3 8 2 7 8 5 10 1 1 9 4 2...
output:
463125
result:
ok 1 number(s): "463125"
Test #14:
score: 0
Accepted
time: 48ms
memory: 15744kb
input:
1000000 10 3 1 5 1 5 7 10 2 10 6 4 4 3 5 5 4 2 7 3 3 9 1 1 5 3 1 5 1 8 1 8 10 8 8 10 4 5 7 10 6 6 6 6 2 9 2 6 10 7 3 3 1 4 7 7 8 1 7 4 3 6 5 2 8 10 5 5 8 1 1 10 4 10 5 1 2 7 5 2 2 5 7 7 8 7 3 9 1 10 4 4 2 6 6 6 4 1 9 8 5 7 9 10 8 8 1 8 10 2 3 6 10 8 8 6 3 6 6 2 8 2 8 7 6 9 8 10 4 6 7 5 3 10 6 8 6 8 ...
output:
463677
result:
ok 1 number(s): "463677"
Test #15:
score: 0
Accepted
time: 53ms
memory: 15648kb
input:
1000000 9 10 5 5 10 3 4 7 7 3 5 8 4 2 3 6 2 9 6 1 7 7 5 6 7 2 4 2 2 2 9 1 5 7 9 5 2 4 9 8 1 9 7 7 9 7 1 9 10 3 1 2 7 9 10 3 4 9 8 5 5 9 8 9 1 2 9 2 9 5 10 7 6 1 9 3 9 2 8 7 2 7 5 7 1 5 9 7 10 10 6 8 1 5 3 10 8 5 9 6 5 2 1 8 10 1 5 9 6 9 5 3 3 3 2 3 6 8 3 10 9 10 1 9 6 7 7 2 5 4 10 8 5 6 2 2 4 8 6 1 ...
output:
463357
result:
ok 1 number(s): "463357"
Test #16:
score: 0
Accepted
time: 48ms
memory: 15684kb
input:
1000000 7 10 9 1 10 10 4 5 10 8 1 9 10 4 2 7 10 7 2 1 1 5 10 9 7 2 1 9 8 3 4 6 6 8 9 7 1 6 3 4 1 1 7 9 9 7 10 2 3 5 9 7 9 3 7 10 10 7 2 9 10 2 10 8 10 2 10 1 6 5 10 3 10 1 10 5 1 8 9 2 5 10 8 4 6 2 4 8 6 4 8 6 10 6 7 10 5 6 9 7 6 4 1 2 10 2 6 8 4 7 2 6 9 6 9 5 3 10 8 4 7 4 4 7 2 8 6 4 7 4 10 1 9 3 1...
output:
463507
result:
ok 1 number(s): "463507"
Test #17:
score: 0
Accepted
time: 54ms
memory: 15884kb
input:
1000000 99 83 60 7 99 29 18 24 78 32 86 39 1 1 5 20 34 88 89 29 50 95 54 19 43 15 29 86 25 25 54 75 89 30 82 31 90 93 9 52 67 66 6 24 88 84 19 48 20 9 17 86 16 63 60 11 70 66 80 89 8 72 65 100 84 44 30 53 25 74 59 62 93 95 45 60 100 8 63 2 2 35 72 32 55 28 100 15 29 9 11 65 60 62 80 35 9 72 31 11 82...
output:
156395
result:
ok 1 number(s): "156395"
Test #18:
score: 0
Accepted
time: 54ms
memory: 15844kb
input:
1000000 83 82 32 3 81 11 8 73 15 94 54 100 59 32 96 20 66 27 3 34 94 81 61 81 19 75 29 81 53 71 21 12 28 30 44 58 80 32 68 70 82 11 66 49 14 42 2 67 10 37 95 100 21 42 68 84 84 18 52 27 3 29 98 15 9 63 77 27 12 54 75 12 90 81 98 29 99 1 62 51 35 20 76 5 96 10 23 28 18 32 88 29 15 13 7 17 74 45 97 39...
output:
156886
result:
ok 1 number(s): "156886"
Test #19:
score: 0
Accepted
time: 54ms
memory: 15688kb
input:
1000000 77 75 68 13 88 10 41 57 4 77 15 2 34 52 65 63 4 48 64 38 17 86 88 64 94 54 77 11 63 58 3 93 69 64 99 69 18 84 73 75 52 60 96 49 92 9 68 17 82 14 38 73 47 70 83 28 15 17 13 74 17 14 8 84 63 54 52 39 57 75 47 41 84 47 79 86 20 12 88 78 78 95 38 48 14 14 11 60 54 49 32 70 83 49 98 3 24 91 4 28 ...
output:
156832
result:
ok 1 number(s): "156832"
Test #20:
score: 0
Accepted
time: 47ms
memory: 15888kb
input:
1000000 48 50 53 13 7 99 64 22 2 7 7 5 84 6 44 10 100 42 91 2 29 71 5 95 83 63 69 39 75 88 42 44 65 26 56 83 24 95 95 26 18 65 41 45 93 59 97 12 19 57 51 40 79 77 58 75 21 58 16 38 54 45 69 7 41 65 47 31 43 84 98 41 4 40 34 76 91 22 20 17 11 84 39 36 90 33 55 22 99 43 67 62 14 61 34 83 96 17 52 51 4...
output:
156404
result:
ok 1 number(s): "156404"
Test #21:
score: 0
Accepted
time: 55ms
memory: 15724kb
input:
1000000 7 8 91 6 14 38 62 59 79 37 16 74 67 1 11 97 16 48 21 70 8 41 75 53 4 21 69 48 17 21 96 45 20 12 48 30 40 11 67 60 84 15 36 76 34 81 80 53 72 19 96 17 57 72 75 40 64 99 60 98 59 66 12 85 15 77 69 98 43 56 51 29 84 8 6 93 92 26 90 68 62 72 14 18 85 27 94 33 36 25 49 85 99 93 54 47 70 13 89 39 ...
output:
156580
result:
ok 1 number(s): "156580"
Test #22:
score: 0
Accepted
time: 51ms
memory: 15624kb
input:
1000000 82 73 62 89 37 51 35 46 96 55 44 39 10 22 6 95 9 26 32 26 44 35 9 29 61 28 16 79 17 30 37 60 17 97 66 55 43 48 88 35 92 80 60 41 92 25 45 97 5 93 99 96 49 93 8 33 45 78 64 67 86 60 15 93 94 23 43 21 82 17 53 38 21 43 29 41 26 27 46 75 82 1 98 6 8 15 61 51 34 96 26 69 1 70 60 94 80 37 77 83 4...
output:
156645
result:
ok 1 number(s): "156645"
Test #23:
score: 0
Accepted
time: 49ms
memory: 15872kb
input:
1000000 58 100 74 69 51 59 50 39 51 59 32 2 100 44 89 54 92 10 36 92 37 23 93 36 86 61 94 42 14 82 38 3 34 18 36 98 31 77 69 99 24 25 91 57 64 8 51 6 65 54 80 63 36 8 37 64 73 2 4 65 58 47 22 59 34 39 72 17 66 19 8 26 40 30 9 88 96 54 37 73 86 28 84 3 16 7 2 80 92 16 38 94 19 58 30 10 88 73 43 16 62...
output:
156657
result:
ok 1 number(s): "156657"
Test #24:
score: 0
Accepted
time: 51ms
memory: 15884kb
input:
1000000 46 23 65 67 80 59 90 19 72 82 47 57 7 51 93 94 90 26 29 62 72 75 29 62 78 28 6 49 78 93 74 96 31 47 78 74 89 79 60 59 37 21 94 82 93 27 3 70 36 57 41 67 1 66 5 45 36 68 16 12 97 35 9 48 17 69 42 85 8 92 11 52 21 8 12 94 53 95 1 95 14 6 91 40 16 90 82 11 14 25 1 49 46 56 2 79 93 98 2 42 80 42...
output:
156806
result:
ok 1 number(s): "156806"
Test #25:
score: 0
Accepted
time: 54ms
memory: 15844kb
input:
1000000 63 46 93 99 100 43 54 76 8 93 59 11 59 36 96 48 47 89 97 79 53 22 49 28 55 83 26 100 24 17 21 24 49 60 84 58 49 48 24 58 3 86 99 30 62 92 13 47 52 58 7 4 44 35 42 88 38 86 51 36 59 36 78 24 69 6 88 11 100 8 17 51 64 8 30 69 1 20 50 4 27 43 88 87 24 37 37 98 56 42 94 66 77 4 91 17 28 21 31 18...
output:
156568
result:
ok 1 number(s): "156568"
Test #26:
score: 0
Accepted
time: 50ms
memory: 15744kb
input:
1000000 45 51 93 16 25 40 90 38 5 50 19 21 97 43 52 59 7 6 1 99 96 71 14 36 29 22 15 39 36 72 53 49 2 78 67 83 88 80 4 37 35 50 60 98 77 71 72 27 94 1 35 10 59 25 49 64 93 25 22 8 84 94 71 99 59 64 59 100 44 49 61 17 84 84 59 49 71 16 99 76 75 56 28 93 71 67 71 70 59 90 24 79 25 54 41 78 22 57 51 80...
output:
156994
result:
ok 1 number(s): "156994"
Test #27:
score: 0
Accepted
time: 53ms
memory: 15752kb
input:
1000000 797 907 623 587 599 217 486 383 719 676 67 505 920 479 46 699 462 351 796 30 568 713 324 838 789 685 567 535 484 576 142 479 747 890 864 479 485 382 893 647 129 274 516 655 223 203 582 77 584 111 266 33 932 118 945 979 539 174 67 277 586 337 620 713 165 967 768 751 210 850 24 515 553 926 96 ...
output:
50223
result:
ok 1 number(s): "50223"
Test #28:
score: 0
Accepted
time: 58ms
memory: 15748kb
input:
1000000 493 387 946 429 308 829 83 174 32 884 368 168 225 50 712 10 887 419 617 251 372 505 946 312 278 723 819 663 117 246 388 260 141 359 59 160 838 98 772 498 610 156 2 946 523 799 640 532 218 802 348 301 909 787 92 188 762 86 486 478 685 765 471 759 107 399 92 604 475 55 832 891 280 511 300 675 ...
output:
50245
result:
ok 1 number(s): "50245"
Test #29:
score: 0
Accepted
time: 57ms
memory: 15624kb
input:
1000000 896 190 923 277 133 945 652 659 122 451 909 134 745 532 91 67 317 948 244 667 792 104 29 575 558 408 70 649 222 825 232 24 361 174 370 699 121 820 96 446 43 902 300 714 860 506 500 686 128 832 367 379 192 583 165 93 134 624 570 960 677 428 72 961 28 173 243 130 735 105 263 519 378 645 605 40...
output:
50139
result:
ok 1 number(s): "50139"
Test #30:
score: 0
Accepted
time: 49ms
memory: 15736kb
input:
1000000 884 147 76 432 481 415 525 148 268 338 463 865 420 514 889 857 296 906 911 87 773 280 579 794 643 40 934 134 903 706 885 587 710 362 347 492 735 352 966 150 298 749 208 313 26 491 362 516 135 221 654 411 464 462 422 967 640 256 558 941 370 722 827 999 950 689 314 966 390 861 187 729 897 2 13...
output:
50147
result:
ok 1 number(s): "50147"
Test #31:
score: 0
Accepted
time: 54ms
memory: 15876kb
input:
1000000 194 69 799 981 45 593 128 410 638 965 921 384 776 348 940 352 262 379 799 599 722 540 973 930 483 990 608 393 652 103 299 592 460 773 728 766 102 983 134 613 788 560 765 423 470 504 791 391 90 787 383 193 823 225 748 913 830 781 116 129 717 597 626 492 362 395 525 906 738 832 821 13 727 933 ...
output:
50156
result:
ok 1 number(s): "50156"
Test #32:
score: 0
Accepted
time: 53ms
memory: 15752kb
input:
1000000 606 480 20 462 25 215 627 432 648 952 503 727 352 244 518 533 167 447 347 57 566 157 144 765 268 717 314 89 536 550 743 674 684 292 201 208 792 216 404 477 311 477 556 667 102 294 712 256 101 392 39 143 4 878 440 58 913 165 500 990 717 25 958 121 28 440 707 795 188 604 805 62 980 88 704 110 ...
output:
50506
result:
ok 1 number(s): "50506"
Test #33:
score: 0
Accepted
time: 53ms
memory: 15872kb
input:
1000000 258 653 934 285 926 219 321 776 520 755 929 559 137 328 434 741 714 555 755 625 575 492 260 625 962 1000 835 208 296 540 827 265 369 138 349 358 411 892 407 969 969 695 498 367 429 216 252 452 137 623 885 759 124 287 295 177 102 781 595 811 526 434 41 941 869 46 907 417 796 653 404 203 978 1...
output:
50110
result:
ok 1 number(s): "50110"
Test #34:
score: 0
Accepted
time: 54ms
memory: 15784kb
input:
1000000 59 313 571 910 123 522 155 117 707 156 994 48 212 5 761 922 985 75 636 798 495 26 391 770 812 774 280 553 819 826 587 798 973 302 68 663 421 495 401 934 137 607 346 99 425 210 912 768 773 127 536 504 383 338 620 792 616 182 321 591 387 834 606 19 347 566 720 206 960 452 84 498 794 833 451 14...
output:
50254
result:
ok 1 number(s): "50254"
Test #35:
score: 0
Accepted
time: 50ms
memory: 15920kb
input:
1000000 792 735 645 251 838 728 316 767 739 534 677 294 788 86 228 187 633 48 293 212 972 406 518 738 640 834 399 769 72 229 322 121 855 566 606 890 752 396 584 864 121 911 845 245 629 413 85 117 818 384 470 413 74 60 553 913 511 459 281 962 541 76 721 120 646 789 172 351 454 438 897 566 533 838 788...
output:
50266
result:
ok 1 number(s): "50266"
Test #36:
score: 0
Accepted
time: 53ms
memory: 15740kb
input:
1000000 292 12 963 920 39 936 962 322 53 956 141 825 582 203 269 929 812 417 873 925 148 762 127 218 337 596 726 30 645 882 623 404 725 157 926 456 955 645 825 397 247 8 380 913 696 529 157 961 473 74 241 41 247 599 766 723 416 991 400 505 999 832 644 960 90 382 583 786 694 351 373 482 266 229 611 5...
output:
50444
result:
ok 1 number(s): "50444"
Test #37:
score: 0
Accepted
time: 64ms
memory: 16264kb
input:
1000000 6339 1788 7109 4450 1454 1797 1849 5358 9310 5558 4093 3841 2068 9845 3963 1330 5824 7528 3678 6657 2537 7450 6281 5788 5638 3975 8481 2440 8946 5414 6916 5835 914 3981 3556 5002 9948 8900 5177 6751 224 4611 7564 1724 4957 8158 661 3132 9165 6845 7788 5316 5174 7937 7536 7899 5670 1607 7100 ...
output:
16001
result:
ok 1 number(s): "16001"
Test #38:
score: 0
Accepted
time: 63ms
memory: 16096kb
input:
1000000 4780 9221 4209 4604 8838 6422 1830 9802 1637 1224 1808 5342 4260 5711 1063 6733 6703 6350 3775 3403 4586 6184 5467 3494 3250 6027 3078 3296 655 7137 992 265 517 6469 5534 8748 2419 6694 5205 7202 8172 9553 2561 1866 8927 4584 2715 9353 9803 6755 9849 5755 2082 123 4128 9367 9474 7345 2860 69...
output:
16052
result:
ok 1 number(s): "16052"
Test #39:
score: 0
Accepted
time: 55ms
memory: 16260kb
input:
1000000 5038 952 1136 6873 5913 9140 5618 8594 6460 7094 6422 5702 7810 9318 5634 8203 604 2984 2400 3498 2744 9787 3909 4107 9892 6488 9722 4800 3722 9545 503 6949 5346 5447 9454 3365 8926 709 2922 1699 1931 1524 9275 9966 6765 243 5541 917 7215 6215 711 9830 4436 9876 8765 7179 7615 248 7164 3884 ...
output:
15915
result:
ok 1 number(s): "15915"
Test #40:
score: 0
Accepted
time: 63ms
memory: 16036kb
input:
1000000 2183 5541 4526 2671 275 5073 5296 5662 3636 2641 4417 8492 8882 4153 4108 369 2023 861 4779 3877 9782 2395 4209 7912 3981 6468 3952 3912 4984 42 6990 4558 1480 9389 7248 1588 6555 8830 3604 129 3645 6675 4321 2703 1227 47 6706 1862 493 1267 7087 9301 6943 8106 6101 9188 1985 5332 9332 3843 6...
output:
15965
result:
ok 1 number(s): "15965"
Test #41:
score: 0
Accepted
time: 65ms
memory: 16032kb
input:
1000000 2231 6756 742 2624 5980 8952 2688 5862 445 3437 632 7688 5148 1945 1051 9691 7248 177 2986 6894 8457 3701 1702 3163 6455 6301 7552 9194 7899 1562 3194 6186 2211 4661 7856 812 5161 5963 2544 4983 4077 9554 9857 8541 7352 3957 2486 6612 1263 1748 8211 8226 8484 6250 6219 6487 9978 9264 6278 42...
output:
15953
result:
ok 1 number(s): "15953"
Test #42:
score: 0
Accepted
time: 59ms
memory: 16136kb
input:
1000000 3149 3206 3884 7910 342 3625 4715 204 1353 2200 7312 8329 3190 1697 1455 9430 1385 108 7315 6775 7293 8062 1345 5951 3835 9403 7625 2748 3427 1043 1370 8732 1587 1618 9261 3511 4312 7062 1656 44 4837 6205 2113 4747 1963 3380 967 875 4217 2545 1070 6017 4317 5462 7735 7992 280 5027 2795 8202 ...
output:
16068
result:
ok 1 number(s): "16068"
Test #43:
score: 0
Accepted
time: 65ms
memory: 16040kb
input:
1000000 59 3382 4673 7848 9242 6285 6503 3951 5012 6597 5238 1496 9055 7956 2556 1802 4930 7948 4139 2467 2573 9236 7145 9766 8501 9587 4953 9602 6736 7739 3529 9322 5475 1273 8963 9764 8113 151 729 861 7721 9941 1060 1920 8021 129 5914 9372 7657 4344 6718 5277 2103 3330 5307 1986 5937 4444 3706 427...
output:
15903
result:
ok 1 number(s): "15903"
Test #44:
score: 0
Accepted
time: 59ms
memory: 16052kb
input:
1000000 8791 6553 4918 6343 4849 7067 35 5969 1706 2357 5210 3629 377 2197 5524 9434 4531 6157 5445 8273 3326 9079 6922 3774 9536 3106 1747 9816 523 2773 75 5632 3433 7968 3852 8276 1377 5618 4202 2223 4490 9970 8659 8967 4979 8364 5627 7617 9046 5457 9784 5596 5374 757 7161 7705 9664 9674 552 9870 ...
output:
15913
result:
ok 1 number(s): "15913"
Test #45:
score: 0
Accepted
time: 63ms
memory: 16120kb
input:
1000000 9808 26 409 5130 5105 5784 8044 4620 8159 3521 8274 4801 3432 1333 2734 5143 4440 3726 5473 9332 5051 6915 5467 854 934 1887 329 3978 8736 6198 3246 5723 6670 4251 1031 9748 5421 5644 9699 676 2149 7424 9631 6551 2758 7652 6105 8311 4314 5202 7992 5103 5625 3268 7080 7820 2569 5365 2672 6487...
output:
15716
result:
ok 1 number(s): "15716"
Test #46:
score: 0
Accepted
time: 64ms
memory: 16052kb
input:
1000000 9960 6493 3026 9603 3759 1708 7385 5824 4808 8139 1030 4882 7804 1889 3597 8545 1906 8505 4080 7097 8189 8465 1910 6859 2546 7552 1157 327 9153 7138 7914 5750 1010 8925 5052 8825 9481 3080 7866 8417 8887 4606 1259 2839 2148 5324 2414 5614 2504 8002 8424 4214 9331 1702 4141 9336 2604 8529 419...
output:
15787
result:
ok 1 number(s): "15787"
Test #47:
score: 0
Accepted
time: 83ms
memory: 19444kb
input:
1000000 59840 3743 48977 16655 67524 40480 94600 27967 96955 24430 68873 72178 61300 95558 92008 5071 91600 88276 26779 86747 89581 47445 58920 46870 14831 59344 61877 74996 69701 84756 26786 37957 31269 69084 15544 18833 73240 97880 16626 93387 47312 90267 16593 38834 25849 97496 69112 26891 10149 ...
output:
5021
result:
ok 1 number(s): "5021"
Test #48:
score: 0
Accepted
time: 83ms
memory: 19448kb
input:
1000000 12354 19571 25174 16179 89517 84034 29069 4336 46205 59657 3581 4632 71650 73726 41179 87064 44751 23953 58341 55056 8627 26482 64156 3580 66348 87782 24832 99555 10501 83178 89082 20359 10556 810 12698 47316 45868 44481 17125 17018 7317 72258 49952 89187 35562 60214 62912 68033 38089 59881 ...
output:
5073
result:
ok 1 number(s): "5073"
Test #49:
score: 0
Accepted
time: 89ms
memory: 19428kb
input:
1000000 61555 41936 33671 14832 4852 13923 42241 17220 91658 80405 43063 13941 67657 45225 6537 86098 2769 94553 43165 92763 23281 29647 44044 3550 83369 36897 10490 24007 15048 65423 38925 66723 35847 39412 30284 25258 32083 80927 31187 31826 26328 47911 60548 93909 8037 50118 187 68071 41407 1469 ...
output:
5037
result:
ok 1 number(s): "5037"
Test #50:
score: 0
Accepted
time: 89ms
memory: 19488kb
input:
1000000 61945 92270 26738 56597 2245 51163 3847 83202 68708 10428 66997 475 87752 1218 26266 72548 91039 95266 27220 49768 60722 84312 51726 7599 92273 15660 69163 96143 22741 62061 78348 44429 77162 19547 43892 46548 95345 59527 45527 10534 40329 57516 80364 18109 16661 93036 49707 65474 84476 9254...
output:
4955
result:
ok 1 number(s): "4955"
Test #51:
score: 0
Accepted
time: 87ms
memory: 19744kb
input:
1000000 71376 17932 26489 82040 8658 65209 80011 58630 44919 86756 44935 76529 840 44338 78482 38561 70720 89649 24530 73525 25406 38129 73702 60840 25808 81522 30592 54247 86894 12837 83937 96927 38488 56811 23079 53277 29883 42205 58511 75478 1566 69956 41729 21919 34597 26240 74145 80422 61325 24...
output:
5085
result:
ok 1 number(s): "5085"
Test #52:
score: 0
Accepted
time: 88ms
memory: 19424kb
input:
1000000 36618 83355 42147 66183 36422 29393 34732 89869 38963 36641 24794 12024 90949 40534 91509 22557 80959 46279 4208 10954 56275 96864 26864 79831 69119 39740 33503 10967 75313 25839 93031 18811 77592 55155 26939 31535 20923 73550 56750 43605 5420 51742 22726 18293 91341 31385 72854 61465 337 18...
output:
5106
result:
ok 1 number(s): "5106"
Test #53:
score: 0
Accepted
time: 90ms
memory: 19464kb
input:
1000000 63751 80645 69179 65550 67411 28296 64891 54805 9487 22378 10132 11340 58976 69057 97448 56083 22989 85041 52184 8437 95240 4078 24708 49527 27654 81652 18204 80801 12826 82528 87160 6916 65139 86683 73311 29908 1669 72814 38193 43252 3512 18362 74940 96417 94914 11103 3597 97137 94890 27559...
output:
4955
result:
ok 1 number(s): "4955"
Test #54:
score: 0
Accepted
time: 80ms
memory: 19444kb
input:
1000000 93224 97948 87033 62406 47441 91271 69009 8591 14669 95705 17124 96683 59589 15992 5557 10535 55974 9135 53524 97297 54287 16590 65823 9078 47600 11099 49032 13668 87993 2208 67861 1688 59478 27363 34302 30230 12705 93022 72314 40712 57297 54541 75191 48313 24451 32282 31060 40276 93839 7399...
output:
5015
result:
ok 1 number(s): "5015"
Test #55:
score: 0
Accepted
time: 87ms
memory: 19340kb
input:
1000000 73542 89830 4396 85742 14906 3594 14836 81703 75822 80366 81117 47784 8181 6709 67995 14982 83933 30246 8492 19394 85116 18214 50623 63171 64803 82497 67420 52506 55007 31766 67116 16707 52668 27074 45438 93670 99588 22652 96361 64562 84201 12030 52241 8703 59846 9816 24484 43202 72017 44819...
output:
4986
result:
ok 1 number(s): "4986"
Test #56:
score: 0
Accepted
time: 85ms
memory: 19380kb
input:
1000000 33938 109 44945 33138 83457 9883 2388 14183 67331 28546 26073 61057 92940 9733 84310 50611 66897 878 43699 93640 2587 37388 99049 37095 94829 80746 41787 44319 5424 55279 53504 99096 56330 46534 51376 88677 84469 87217 12841 67265 47490 39563 91836 19893 95097 42675 48564 70056 68134 8320 57...
output:
5047
result:
ok 1 number(s): "5047"
Test #57:
score: 0
Accepted
time: 233ms
memory: 56052kb
input:
1000000 -113364214 -920443443 599224783 769936993 444942257 -948250393 -344476045 429527019 607864648 -752265639 -102003926 -439060364 -119239645 994107532 -852320687 -435958658 -385356253 438478713 -5768393 -586412029 863572820 772022191 -827785023 808938688 440404688 802536133 -534102839 622677841...
output:
28
result:
ok 1 number(s): "28"
Test #58:
score: 0
Accepted
time: 215ms
memory: 56704kb
input:
1000000 753535843 -861698822 -882249104 -412448790 -719933945 -368066472 670814072 703199356 -80006057 -732822732 18318608 427539691 187888372 232193375 190687280 -706517613 -9732607 915539972 473645548 -443767285 -925782803 34474506 -586399902 610294931 28597260 -980779514 208134427 -829261154 6317...
output:
42
result:
ok 1 number(s): "42"
Test #59:
score: 0
Accepted
time: 206ms
memory: 56340kb
input:
1000000 -702155817 297454566 -638067642 181522948 -933432343 -70881800 -113237184 382446686 179798361 336916040 -53146700 -182454382 -744723831 248186298 72191656 364288362 -655615744 66596499 111903784 -601562214 537318956 529777576 753582718 -37897242 -148130313 -28309079 -779728007 782802427 -671...
output:
34
result:
ok 1 number(s): "34"
Test #60:
score: 0
Accepted
time: 207ms
memory: 56804kb
input:
1000000 -769186605 175007366 -47873363 73339100 -891289402 -809551768 -683566248 318933375 -42202 -859830807 -346547949 -647302349 -730156595 319389786 -537765269 730389871 932477727 704661047 111275922 -492718817 413738522 429025083 623463337 -505985770 712163761 528565799 -258546129 -398369508 -48...
output:
36
result:
ok 1 number(s): "36"
Test #61:
score: 0
Accepted
time: 218ms
memory: 56520kb
input:
1000000 642995364 192935175 -734134756 -740572092 450980084 18480966 -817769885 -853770181 407552806 610049374 528141525 -38059747 -130145420 -32768081 -959263358 419232750 -539827128 973731578 137657420 896092348 261245205 -937224827 675332912 163464370 447634820 557591358 -870782517 -578160016 -51...
output:
42
result:
ok 1 number(s): "42"
Test #62:
score: 0
Accepted
time: 222ms
memory: 56216kb
input:
1000000 -56649600 -254010067 958025840 -49752233 -981678500 -14806237 260531267 873205143 40763740 -745814677 993732131 -186224047 -446288311 109528347 -458957111 834395200 462729837 625488281 798850190 494621819 -163932787 80713547 318585700 391915417 -241406418 -440235533 697363720 -833742286 -260...
output:
40
result:
ok 1 number(s): "40"
Test #63:
score: 0
Accepted
time: 204ms
memory: 56948kb
input:
1000000 -261705430 893708206 136349739 -483415431 -224766109 -324478161 -834884823 -366147236 407237850 -504196110 -717505626 -43013747 -535425431 135321837 -944150710 -599475199 430561045 -257248301 939647746 459914037 734476758 263918004 910454554 -335246777 -290517516 -371757008 313759378 2556010...
output:
32
result:
ok 1 number(s): "32"
Test #64:
score: 0
Accepted
time: 219ms
memory: 55788kb
input:
1000000 684263891 604052363 -914013267 -134349178 206297998 202606004 -412667584 333179734 397633094 219166902 -215588910 -632742039 758659306 -632366144 555823519 -199911045 666477140 -413186831 207052877 456583412 -460589920 648847914 -520882820 -29799022 -338917949 132999430 295620867 385913127 1...
output:
34
result:
ok 1 number(s): "34"
Test #65:
score: 0
Accepted
time: 222ms
memory: 57152kb
input:
1000000 -564484995 523225627 -451540717 181259277 -571533385 -695596837 -433645209 -166953971 -540603262 -39507752 196749772 -281078562 59194967 729503283 -976382202 -632410088 837751530 -726513936 923063976 -450638781 -10183088 -362432265 921825616 -975638939 -922903673 -288969316 450713196 7504829...
output:
32
result:
ok 1 number(s): "32"
Test #66:
score: 0
Accepted
time: 216ms
memory: 56172kb
input:
1000000 245234724 918172207 27664568 -884229642 -478361753 -611050611 -14897861 -358571396 -926833809 175873241 -814900220 -934190863 501438134 415179385 -384220495 -596373427 -17780714 -126071443 -244235343 954833195 -505692845 -369156835 641308304 662584802 517527111 -840748907 -93514745 827427806...
output:
38
result:
ok 1 number(s): "38"
Test #67:
score: 0
Accepted
time: 89ms
memory: 55308kb
input:
1000000 -1000000 -999999 -999998 -999997 -999996 -999995 -999994 -999993 -999992 -999991 -999990 -999989 -999988 -999987 -999986 -999985 -999984 -999983 -999982 -999981 -999980 -999979 -999978 -999977 -999976 -999975 -999974 -999973 -999972 -999971 -999970 -999969 -999968 -999967 -999966 -999965 -99...
output:
0
result:
ok 1 number(s): "0"
Test #68:
score: 0
Accepted
time: 84ms
memory: 55444kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
0
result:
ok 1 number(s): "0"
Test #69:
score: 0
Accepted
time: 2ms
memory: 10692kb
input:
8 4 1 2 3 4 4 5 3
output:
3
result:
ok 1 number(s): "3"
Test #70:
score: 0
Accepted
time: 47ms
memory: 15700kb
input:
1000000 1 1 2 1 1 2 2 2 1 2 2 2 2 2 1 2 2 1 2 1 1 2 1 1 1 1 1 1 2 2 2 2 1 1 1 2 1 2 1 2 2 1 1 1 2 2 1 2 1 1 2 1 2 2 2 1 2 1 2 2 2 1 2 1 1 2 2 1 2 1 2 1 1 1 2 1 1 1 2 1 1 2 1 2 2 2 1 2 1 2 1 1 2 2 1 1 1 2 1 1 2 2 2 1 2 2 2 2 1 1 2 2 2 1 2 2 2 2 2 1 1 1 2 2 1 1 2 2 1 2 2 2 1 2 2 1 2 1 2 1 2 1 2 1 1 2 ...
output:
857384
result:
ok 1 number(s): "857384"
Test #71:
score: 0
Accepted
time: 47ms
memory: 15644kb
input:
1000000 1 2 1 3 3 2 2 3 2 2 1 2 1 1 3 3 1 1 1 1 3 2 2 1 2 1 3 3 2 2 3 1 3 1 2 2 2 1 3 2 2 3 2 1 2 3 3 2 3 1 2 1 1 1 1 1 1 1 1 3 1 2 2 1 2 3 1 2 1 2 2 2 3 2 3 3 1 3 3 3 3 3 1 1 3 1 2 2 2 3 3 3 3 2 2 1 2 2 1 2 2 1 1 1 3 3 3 2 2 2 2 3 3 3 2 2 2 1 3 1 2 3 3 2 1 3 1 3 2 1 3 1 3 3 1 2 3 1 1 2 2 2 2 2 3 2 ...
output:
751763
result:
ok 1 number(s): "751763"
Extra Test:
score: 0
Extra Test Passed