QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#114764#5515. Cat Exerciselmeowdn100 ✓172ms65528kbC++142.1kb2023-06-23 15:33:192023-06-23 15:33:20

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-23 15:33:20]
  • 评测
  • 测评结果:100
  • 用时:172ms
  • 内存:65528kb
  • [2023-06-23 15:33:19]
  • 提交

answer

#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}

#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
  return x*w;
}

const int N=2e5+5;
int n,id[N],p[N],d[N],fa[N][25],f[N];
vi e[N];

int find(int i) {return i==id[i]?i:id[i]=find(id[i]);}
void dfs(int u,int ft) {
  d[u]=d[ft]+1; fa[u][0]=ft;
  rep(h,1,20) fa[u][h]=fa[fa[u][h-1]][h-1];
  for(int v:e[u]) if(v!=ft) dfs(v,u);
}
int lca(int u,int v) {
  if(d[u]<d[v]) swap(u,v);
  per(h,20,0) if(d[fa[u][h]]>=d[v]) u=fa[u][h];
  per(h,20,0) if(fa[u][h]!=fa[v][h]) u=fa[u][h], v=fa[v][h];
  return u==v?u:fa[u][0];
}
int dis(int u,int v) {
  return d[u]+d[v]-2*d[lca(u,v)];
}

signed main() {
  n=read();
  rep(i,1,n) p[i]=read(), id[i]=i;
  rep(i,2,n) {
    int u=p[read()], v=p[read()];
    e[u].eb(v), e[v].eb(u);
  }
  dfs(n,0);
  rep(u,1,n) {
    for(int v:e[u]) if(v<u) {
      v=find(v);
      f[u]=max(f[u],f[v]+dis(u,v));
      id[v]=u;
    }
  }
  printf("%lld\n",f[n]);
  return 0;
}

详细

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 0ms
memory: 15828kb

input:

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

output:

10

result:

ok single line: '10'

Test #2:

score: 0
Accepted
time: 3ms
memory: 12856kb

input:

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

output:

10

result:

ok single line: '10'

Test #3:

score: 0
Accepted
time: 1ms
memory: 13388kb

input:

16
16 14 12 10 8 6 4 2 1 3 5 7 9 11 13 15
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

120

result:

ok single line: '120'

Test #4:

score: 0
Accepted
time: 0ms
memory: 13428kb

input:

16
15 14 13 12 10 9 8 5 4 3 2 1 6 7 11 16
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

58

result:

ok single line: '58'

Test #5:

score: 0
Accepted
time: 1ms
memory: 15732kb

input:

16
16 14 13 12 2 10 7 4 3 1 5 6 8 9 11 15
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

77

result:

ok single line: '77'

Test #6:

score: 0
Accepted
time: 1ms
memory: 13204kb

input:

2
1 2
1 2

output:

1

result:

ok single line: '1'

Test #7:

score: 0
Accepted
time: 3ms
memory: 13596kb

input:

16
12 15 5 2 13 4 7 6 1 11 14 10 3 9 16 8
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

38

result:

ok single line: '38'

Test #8:

score: 0
Accepted
time: 3ms
memory: 14564kb

input:

16
16 8 7 9 1 5 3 13 11 15 12 10 2 4 14 6
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

22

result:

ok single line: '22'

Test #9:

score: 0
Accepted
time: 0ms
memory: 14584kb

input:

16
2 14 8 11 16 1 3 7 12 6 13 5 9 15 10 4
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

output:

17

result:

ok single line: '17'

Subtask #2:

score: 7
Accepted

Dependency #1:

100%
Accepted

Test #10:

score: 7
Accepted
time: 1ms
memory: 13100kb

input:

300
300 298 296 294 292 290 288 286 284 282 280 278 276 274 272 270 268 266 264 262 260 258 256 254 252 250 248 246 244 242 240 238 236 234 232 230 228 226 224 222 220 218 216 214 212 210 208 206 204 202 200 198 196 194 192 190 188 186 184 182 180 178 176 174 172 170 168 166 164 162 160 158 156 154 ...

output:

44850

result:

ok single line: '44850'

Test #11:

score: 0
Accepted
time: 0ms
memory: 16012kb

input:

300
298 30 295 294 291 289 283 280 277 275 273 271 270 268 267 29 263 262 261 28 257 256 255 27 254 253 252 249 246 245 242 241 240 238 236 230 227 226 223 221 26 217 216 214 213 210 209 204 200 197 25 196 194 193 191 185 178 24 177 176 175 173 171 23 170 169 168 164 163 160 158 157 156 153 152 151 ...

output:

20638

result:

ok single line: '20638'

Test #12:

score: 0
Accepted
time: 3ms
memory: 16044kb

input:

300
299 297 296 294 290 289 288 286 285 284 283 281 280 279 278 277 276 22 274 273 271 269 268 267 266 264 259 255 250 247 21 246 244 242 241 240 239 237 234 233 232 230 228 226 225 224 223 221 219 214 213 211 209 207 206 203 202 201 200 199 195 194 189 187 186 185 182 181 20 176 174 172 171 170 19 ...

output:

22062

result:

ok single line: '22062'

Test #13:

score: 0
Accepted
time: 3ms
memory: 13696kb

input:

300
158 241 135 137 113 59 275 127 261 65 28 112 20 101 299 263 295 209 92 129 54 86 109 105 44 102 280 220 221 196 73 74 214 224 228 91 57 38 146 274 47 56 175 232 188 173 182 143 210 130 284 257 122 141 165 237 3 167 187 278 208 85 200 155 140 283 223 273 150 191 32 216 151 204 18 63 156 258 71 31...

output:

853

result:

ok single line: '853'

Test #14:

score: 0
Accepted
time: 3ms
memory: 13076kb

input:

300
106 208 19 26 155 205 219 25 57 115 210 68 231 175 140 139 81 248 199 172 261 192 200 50 239 291 133 36 191 204 216 122 95 35 126 275 151 73 146 188 241 144 79 42 66 189 121 270 297 53 15 117 282 8 193 46 246 264 252 78 135 157 247 169 28 167 160 130 224 64 31 29 105 56 102 237 14 226 104 174 11...

output:

613

result:

ok single line: '613'

Test #15:

score: 0
Accepted
time: 2ms
memory: 16024kb

input:

300
51 181 14 64 161 90 27 26 5 67 103 156 209 36 272 229 120 33 237 71 298 32 22 260 96 182 243 300 207 72 94 221 113 124 52 167 210 282 244 173 16 184 60 228 273 152 100 172 245 131 17 191 258 21 189 192 44 25 217 112 75 121 55 57 223 137 231 145 215 270 240 54 130 285 56 139 238 115 277 4 205 129...

output:

409

result:

ok single line: '409'

Test #16:

score: 0
Accepted
time: 2ms
memory: 14328kb

input:

300
81 20 270 26 143 217 119 135 46 292 108 246 106 11 95 69 121 100 226 7 234 249 181 104 90 83 5 51 272 174 190 35 224 216 179 9 1 61 297 299 92 49 263 218 88 300 164 32 146 207 203 155 245 125 42 291 148 153 288 191 259 240 220 111 84 298 126 172 107 149 96 123 29 99 128 169 248 275 31 57 170 78 ...

output:

448

result:

ok single line: '448'

Subtask #3:

score: 7
Accepted

Dependency #2:

100%
Accepted

Test #17:

score: 7
Accepted
time: 1ms
memory: 13988kb

input:

5000
5000 4998 4996 4994 4992 4990 4988 4986 4984 4982 4980 4978 4976 4974 4972 4970 4968 4966 4964 4962 4960 4958 4956 4954 4952 4950 4948 4946 4944 4942 4940 4938 4936 4934 4932 4930 4928 4926 4924 4922 4920 4918 4916 4914 4912 4910 4908 4906 4904 4902 4900 4898 4896 4894 4892 4890 4888 4886 4884 ...

output:

12497500

result:

ok single line: '12497500'

Test #18:

score: 0
Accepted
time: 1ms
memory: 16508kb

input:

5000
4998 4997 4995 4993 4990 457 4989 4987 4986 4984 4983 4982 4979 4977 4976 4975 4974 4970 4969 456 4968 4966 4962 455 4960 4959 4957 454 4954 4949 4948 4947 4942 4941 4937 4935 4933 4932 4931 4928 4927 4926 4925 4920 4919 453 4918 4914 4912 4911 4910 452 4906 4905 4904 4903 4902 4901 4898 451 48...

output:

5574749

result:

ok single line: '5574749'

Test #19:

score: 0
Accepted
time: 5ms
memory: 16424kb

input:

5000
4998 4997 4996 4994 4993 469 4991 4987 4986 4983 4982 4981 4978 4975 4972 4969 4968 4965 4963 4962 4958 4954 4950 468 4947 4941 4937 4934 4933 4930 4929 4927 4926 4925 467 4923 4920 4919 466 4914 4913 4912 4911 4909 4908 4907 4906 4905 4904 4903 4900 4898 4895 465 4891 4889 4886 4883 4878 464 4...

output:

5641202

result:

ok single line: '5641202'

Test #20:

score: 0
Accepted
time: 6ms
memory: 14092kb

input:

5000
1173 1790 485 3355 881 383 955 3750 3520 3284 1637 1197 4388 1451 1390 1448 3007 3857 693 3139 4082 685 3022 2716 3047 4938 4228 2858 4633 664 4848 2245 2881 3257 4962 3583 3312 3535 4835 582 3925 2799 213 3329 1865 4787 1794 3074 568 473 3812 4692 3191 4084 4609 2618 2082 3199 815 105 2448 246...

output:

6072

result:

ok single line: '6072'

Test #21:

score: 0
Accepted
time: 4ms
memory: 16428kb

input:

5000
4372 716 1450 4881 3404 3964 4918 2154 3897 4195 3426 1964 412 2905 3731 572 3641 1169 4191 1480 384 2241 4781 2952 947 677 462 1982 228 3644 3470 2911 4000 3906 4314 1127 3807 548 2578 3995 277 2498 702 789 703 2912 2846 4747 3898 1553 4495 996 782 496 1276 914 1384 3436 3626 1332 4739 3324 40...

output:

9050

result:

ok single line: '9050'

Test #22:

score: 0
Accepted
time: 1ms
memory: 13896kb

input:

5000
2717 539 4388 4260 3811 4870 921 987 2100 2686 4296 2588 4683 1893 2807 4244 4777 2293 1563 3510 3608 4656 2284 1041 4750 794 1850 3062 2743 1859 1921 856 4953 2327 460 2709 3416 491 543 4964 1272 4230 58 533 3554 2661 544 106 1849 2172 975 214 1540 3537 3105 3367 4686 2737 3206 2781 888 2844 1...

output:

6106

result:

ok single line: '6106'

Test #23:

score: 0
Accepted
time: 1ms
memory: 16492kb

input:

5000
2530 1608 3085 3987 3449 1301 346 2839 3532 1308 3663 3716 2871 2154 4443 1378 592 2688 401 2574 4723 4948 1056 1588 1681 1447 4696 260 2814 1825 2510 4393 2037 315 3804 2468 3905 2639 742 1593 4435 3769 2892 4371 3039 4763 1190 1047 1706 3216 854 2604 3047 3476 1444 283 2249 3512 3319 210 3780...

output:

4633

result:

ok single line: '4633'

Subtask #4:

score: 10
Accepted

Dependency #3:

100%
Accepted

Test #24:

score: 10
Accepted
time: 5ms
memory: 16576kb

input:

5000
2443 4316 4835 3133 2064 1132 2595 1618 709 2401 4411 1332 3143 4533 1645 1069 1141 2036 571 3166 1862 2973 2701 1056 2286 777 343 1341 891 3956 682 1789 1101 2124 642 2399 1175 430 2100 3616 916 1239 4343 4322 4012 1632 1846 4720 1484 3473 3953 690 186 1607 2095 3482 2651 4974 3954 2239 4775 3...

output:

3141224

result:

ok single line: '3141224'

Test #25:

score: 0
Accepted
time: 0ms
memory: 15496kb

input:

5000
1461 2143 636 1327 3099 1008 3862 764 861 517 97 1183 4533 2145 81 1238 3165 1768 363 1975 1346 3863 673 4028 4095 4189 1375 2741 4323 2221 2476 2587 2282 2955 2558 4046 3753 143 1471 1779 942 3180 532 3910 3987 3460 2800 3713 3937 4485 3372 4069 1643 2528 3473 444 2229 1544 832 4781 983 4866 1...

output:

3161222

result:

ok single line: '3161222'

Test #26:

score: 0
Accepted
time: 5ms
memory: 16720kb

input:

5000
877 2529 4583 977 3596 4179 718 4192 2653 4763 1045 626 4786 4569 2826 1750 943 780 980 2917 1006 1535 2032 566 2818 2300 4958 115 4523 3617 2454 1603 1243 3772 3845 1041 2735 4269 2453 2819 2943 2449 1770 3394 3503 4314 4538 440 3848 3521 2226 250 2937 136 4744 1341 296 4610 338 3273 3739 1795...

output:

3104067

result:

ok single line: '3104067'

Test #27:

score: 0
Accepted
time: 5ms
memory: 13428kb

input:

5000
284 728 3780 3349 2304 1667 481 2286 3992 3127 2267 2708 703 560 667 1959 4931 1860 3292 1539 1018 4125 561 2379 3331 2657 175 207 2846 4557 2747 2082 4883 2598 4770 3532 279 2778 3027 3577 3005 959 1259 2826 3888 4164 4402 1332 1296 335 4038 2094 1440 4456 293 2910 4529 3335 146 4012 468 213 8...

output:

3028608

result:

ok single line: '3028608'

Test #28:

score: 0
Accepted
time: 3ms
memory: 13836kb

input:

5000
1327 1167 4074 1668 2623 2814 3670 2255 2039 1079 4343 284 1448 2868 705 2103 1115 4015 130 4524 818 1399 4893 950 134 1936 456 1585 564 4187 4696 2144 4478 2314 2227 3117 4881 1400 58 4328 244 828 4461 4241 1487 427 2675 634 1263 2343 4781 658 3959 4366 4147 1996 264 3649 4839 1967 879 3981 29...

output:

3236

result:

ok single line: '3236'

Test #29:

score: 0
Accepted
time: 3ms
memory: 15972kb

input:

5000
16 2342 1372 372 1890 3654 4812 4307 2689 4982 1881 1309 3863 2897 388 4031 2026 3256 4412 1080 4306 4483 2656 4089 933 1198 1096 1597 639 3609 4120 2611 559 1512 623 709 1724 4780 2136 689 3766 119 4423 1413 1904 3532 3503 2363 4081 1607 2329 1506 4638 3511 3903 4234 4949 251 4041 765 2921 358...

output:

8215

result:

ok single line: '8215'

Test #30:

score: 0
Accepted
time: 0ms
memory: 16332kb

input:

5000
676 4812 4561 3717 4493 995 4212 1194 4445 3928 1473 2414 4514 4452 3456 496 3376 4930 1524 1436 386 3670 2231 846 4601 48 1827 946 4597 2473 242 4629 2912 2245 3138 1697 3884 3960 2085 2546 859 3779 969 2946 317 4495 2803 2547 2116 3379 2807 1722 1151 1612 2971 2201 2851 2753 3013 1650 2000 30...

output:

5169

result:

ok single line: '5169'

Test #31:

score: 0
Accepted
time: 3ms
memory: 15944kb

input:

5000
1145 3129 1935 4752 4430 3169 1051 4710 3335 4755 262 4267 492 627 49 1826 2524 2375 4447 4721 2916 4300 3293 2387 2728 1774 279 4598 4534 4173 2809 3515 1949 346 166 973 3214 1166 2988 1707 1032 3229 2833 137 1839 1077 3094 2050 4265 4974 1364 4633 3379 3697 4223 862 4691 55 820 4431 2022 2051...

output:

7500

result:

ok single line: '7500'

Subtask #5:

score: 20
Accepted

Test #32:

score: 20
Accepted
time: 66ms
memory: 65528kb

input:

200000
200000 199998 199996 199994 199992 199990 199988 199986 199984 199982 199980 199978 199976 199974 199972 199970 199968 199966 199964 199962 199960 199958 199956 199954 199952 199950 199948 199946 199944 199942 199940 199938 199936 199934 199932 199930 199928 199926 199924 199922 199920 199918...

output:

19999900000

result:

ok single line: '19999900000'

Test #33:

score: 0
Accepted
time: 62ms
memory: 65488kb

input:

200000
200000 199998 199996 199995 18252 199991 199990 199988 199987 199986 18251 199985 199984 199982 199981 199980 199976 18250 199973 199972 199971 199970 199969 199966 18249 199965 199963 199957 199955 199954 199944 199941 199939 199938 199935 199932 199931 199930 199928 199926 199925 199924 199...

output:

9060506001

result:

ok single line: '9060506001'

Test #34:

score: 0
Accepted
time: 65ms
memory: 65472kb

input:

200000
199997 199996 199995 199993 199992 199991 199990 199989 199987 199985 199984 199983 199981 199978 199976 199975 199974 199972 199971 199970 199968 18095 199967 199966 199963 199960 18094 199959 199958 18093 199957 18092 199954 199953 199951 199950 18091 199948 18090 199945 199940 199938 18089...

output:

9074945378

result:

ok single line: '9074945378'

Test #35:

score: 0
Accepted
time: 162ms
memory: 64020kb

input:

200000
42401 91167 141914 191660 46454 68949 90294 49039 116100 145219 19872 71462 101096 87178 83838 21235 62933 38794 66584 129437 63470 17371 74376 101660 149974 195618 61662 15659 22135 155683 93510 56485 132867 11344 115050 19358 155129 17368 117781 128630 153556 7965 91508 70077 47630 199010 1...

output:

277038

result:

ok single line: '277038'

Test #36:

score: 0
Accepted
time: 157ms
memory: 64804kb

input:

200000
161181 6860 158882 194143 75312 48099 21697 144175 100727 37875 53288 44133 161207 25589 29050 27612 198422 102932 5212 11454 198873 140189 28618 66621 101289 169001 48476 164716 46585 113776 71786 199876 133394 12855 97147 137727 181589 124892 168476 60264 138764 56376 91231 138619 102879 12...

output:

338079

result:

ok single line: '338079'

Test #37:

score: 0
Accepted
time: 168ms
memory: 64652kb

input:

200000
100808 163247 172580 169592 7443 179709 54651 191813 133487 133699 118411 48174 52701 145341 12735 100040 119192 148554 145180 138910 136322 170005 152222 90291 77872 51326 60813 118587 100385 140725 94750 104607 74166 4015 14238 61085 195516 49884 39949 11137 60398 44529 41409 107721 58450 1...

output:

241096

result:

ok single line: '241096'

Test #38:

score: 0
Accepted
time: 172ms
memory: 64876kb

input:

200000
84319 171056 41004 28255 187389 39854 54341 13660 59011 46451 174769 91456 59225 79549 66252 136129 110604 188596 199048 150757 78684 70754 45528 91368 54838 95365 103938 15795 40624 76924 188347 96580 132337 185407 36446 97379 123584 16399 657 186219 196064 58779 82266 1731 172362 82958 1159...

output:

432886

result:

ok single line: '432886'

Subtask #6:

score: 23
Accepted

Test #39:

score: 23
Accepted
time: 1ms
memory: 12912kb

input:

200
49 181 133 160 142 76 134 189 25 167 10 54 59 158 186 53 58 145 95 9 27 30 116 77 140 173 131 21 151 128 190 51 19 112 40 161 136 93 46 52 45 84 18 42 63 43 73 188 147 153 124 127 177 32 75 150 96 175 34 183 106 13 80 196 141 198 67 26 92 192 191 172 90 83 164 180 107 143 121 146 125 174 139 104...

output:

256

result:

ok single line: '256'

Test #40:

score: 0
Accepted
time: 136ms
memory: 61504kb

input:

200000
47590 74846 33440 172120 93313 6143 118842 183554 57721 114949 56442 25767 28220 10101 116823 185481 76250 82471 149808 167830 176621 84906 178870 135367 94129 107804 33861 133096 39663 156399 193810 84691 45814 156960 107510 195808 47135 17660 119624 99945 87252 140615 92398 154908 120735 15...

output:

432517

result:

ok single line: '432517'

Test #41:

score: 0
Accepted
time: 119ms
memory: 61432kb

input:

200000
54514 132138 136991 158483 149121 87580 164108 86612 22687 92566 45018 38190 71624 146051 34722 140067 56355 83040 61329 154797 35240 11212 70478 94271 46277 166489 110079 98582 165864 111293 15446 143673 99507 13750 83946 132565 13323 185680 63850 63999 67105 15785 85805 153610 42258 14357 1...

output:

486019

result:

ok single line: '486019'

Test #42:

score: 0
Accepted
time: 126ms
memory: 61480kb

input:

200000
67281 123460 65755 103449 80776 37208 166821 2511 113868 129359 63375 172281 111678 75568 198230 134639 58140 171726 134196 45888 101272 137261 155291 97353 59848 119410 147885 64293 144417 117383 114431 127365 121467 94143 42470 68084 188544 176844 21694 59475 23226 123527 12303 48756 59959 ...

output:

410237

result:

ok single line: '410237'

Subtask #7:

score: 26
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #43:

score: 26
Accepted
time: 107ms
memory: 64292kb

input:

200000
100683 152005 62466 51212 107058 87248 25966 55997 138616 84551 58229 4350 173519 7677 1006 53869 46002 179865 141621 54366 51309 193426 1319 116970 84895 60795 97909 38589 9848 50565 60628 5394 156106 161139 180882 51729 10853 122551 109801 3436 45375 152322 2979 124129 101592 22048 129345 1...

output:

4870246248

result:

ok single line: '4870246248'

Test #44:

score: 0
Accepted
time: 119ms
memory: 64252kb

input:

200000
105630 70592 110611 127473 179706 121658 186657 194411 100704 161806 45187 32302 104649 158621 76726 19421 192464 11219 180309 45810 184222 42965 28417 35847 138057 72006 18857 140184 117341 195410 21020 35238 42287 7819 121725 67162 105355 86083 148364 13905 199988 62315 61689 67093 4234 783...

output:

4911831228

result:

ok single line: '4911831228'

Test #45:

score: 0
Accepted
time: 115ms
memory: 64852kb

input:

200000
157517 117223 165261 37483 33791 103609 167808 161404 159720 165290 39404 30201 170771 149242 85909 50527 71254 189276 51351 143724 82063 143577 95384 153233 116734 75663 18559 166072 199180 76146 165118 93126 53827 167912 147933 67022 47322 188176 32609 127299 188907 133251 140709 94668 2684...

output:

4915860941

result:

ok single line: '4915860941'

Test #46:

score: 0
Accepted
time: 108ms
memory: 64264kb

input:

200000
66036 28908 169843 103093 172681 156158 6571 53133 187238 36856 60612 45663 23948 29608 168395 176368 169933 179362 24914 140432 122279 1973 172865 111009 128693 187519 22252 189040 152773 158195 64638 121200 58077 163950 18487 168392 40226 178941 118986 45156 47663 91241 96964 45461 94172 17...

output:

4911756163

result:

ok single line: '4911756163'

Test #47:

score: 0
Accepted
time: 167ms
memory: 60908kb

input:

200000
180908 127210 71688 195186 75117 86517 198103 94098 113746 129152 55557 61049 119190 130847 118380 165257 166587 155551 5171 188595 168399 138554 80749 141469 40301 47304 69732 37842 140837 93744 144490 131527 196614 181809 104426 178048 100448 95341 127023 68124 191548 151991 38470 6097 2692...

output:

368622

result:

ok single line: '368622'

Test #48:

score: 0
Accepted
time: 156ms
memory: 60972kb

input:

200000
2126 31523 114968 168867 182346 15487 18186 144538 95823 98367 77991 160374 142645 94404 95539 148160 19127 120102 40464 183221 119259 76091 99336 128140 158661 32356 68570 176589 4113 123542 188454 89515 51135 164773 11596 77683 51588 60141 45447 175453 169590 32915 167870 22561 136530 12675...

output:

518622

result:

ok single line: '518622'

Test #49:

score: 0
Accepted
time: 157ms
memory: 61012kb

input:

200000
26213 100273 62456 195476 61378 118074 50295 104938 185690 91230 115332 166222 195125 19920 58978 124140 125216 6435 165565 89041 103272 126590 74820 122163 119724 118690 4051 152442 194924 162204 31781 30337 7478 21979 107662 157262 158081 149203 133448 139076 174172 134574 1579 182412 9208 ...

output:

280904

result:

ok single line: '280904'

Test #50:

score: 0
Accepted
time: 142ms
memory: 60908kb

input:

200000
138998 190765 84348 31284 147720 148768 90676 67185 175963 22276 112493 141793 60350 177790 175477 112118 198152 51583 181987 23586 23398 35771 16808 127957 198876 133738 61905 118761 53004 18441 120051 29163 46591 173854 162378 133632 149691 189309 76134 80460 107618 176130 22353 176923 9446...

output:

466714

result:

ok single line: '466714'

Extra Test:

score: 0
Extra Test Passed