ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#213000 | #3844. B | shiruiheng | 0 | 131ms | 2448kb | C++11 | 604b | 2024-10-27 12:58:41 | 2024-10-27 13:04:08 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
//using LL = __int128
#define pi pair<ll, ll>
#define fi first
#define se second
#define N 111111
ll t, n, a[N], x, y, d[N];
int main(){
scanf("%lld", &t);
while(t--){
scanf("%lld", &n);
for(int i = 1 ; i <= n ; i++)
scanf("%lld", &a[i]);
memset(d, 0, sizeof d);
ll ans = (n == 2) * a[1];
for(int i = 1 ; i < n ; i++){
scanf("%lld%lld", &x, &y);
ans = max(ans, a[max(x, y)]);
}
printf("%lld", ans);
}
return 0;
}
/*
freopen(".in", "r", stdin);
freopen(".out", "w", stdout);
*/
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 2064kb
input:
100 10 103717049 747895296 827450707 194881991 56246174 316941251 862709303 201105248 897349432 7985...
output:
8973494327149015539119107637763333169942084069690422158352054618708344337629861038870525344974211619...
result:
wrong answer 1st lines differ - expected: '194881991', found: '897349432714901553911910763776...9865...
Test #2:
score: 0
Wrong Answer
time: 5ms
memory: 2060kb
input:
100 9 437413060 220941142 307419141 165980578 366017110 467317665 994255993 773949952 248687675 1 2 ...
output:
9942559939664577729907901549711999589727331019586428499856168089934633579028907279748891569503367069...
result:
wrong answer 1st lines differ - expected: '307419141', found: '994255993966457772990790154971...6617...
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 2064kb
input:
100 74 735587102 208983225 244593148 17016789 332931999 947146306 707706314 804221526 263031711 7922...
output:
9876904889827105709964624809695933927710243569940550269978586739886469288770517309919316459987094129...
result:
wrong answer 1st lines differ - expected: '735587102', found: '987690488982710570996462480969...5957...
Test #4:
score: 0
Wrong Answer
time: 20ms
memory: 2428kb
input:
114 37 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 1 0 0 0 0 0 1 1 1 0 1 1 2 2 3 2 4 1 5 4 6...
output:
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
wrong answer 1st lines differ - expected: '0', found: '111111111111111111111111111111...111111111111...
Test #5:
score: 0
Wrong Answer
time: 17ms
memory: 2304kb
input:
114 97 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1 0 1 0...
output:
1111011101111111111111111111111110111111011111111111111111111111111111111111111111111111111111111111...
result:
wrong answer 1st lines differ - expected: '0', found: '111101110111111111111111111111...111111111111...
Test #6:
score: 0
Wrong Answer
time: 17ms
memory: 2268kb
input:
114 88 781943290 86488882 88780042 274439482 229751860 714115187 27893563 394958056 351245885 880381...
output:
9953921939409531399658316899734989219196679839950781969356717225742126399794776954482376699399915388...
result:
wrong answer 1st lines differ - expected: '781943290', found: '995392193940953139965831689973...0506...
Test #7:
score: 0
Wrong Answer
time: 11ms
memory: 2112kb
input:
114 6 69118224 584310431 962956728 324710518 72943796 689535865 1 2 2 3 3 4 4 5 5 6 61 799714124 424...
output:
9629567289987549539773662559980473410964863459980137446998355094759816095999888218952171094822062151...
result:
wrong answer 1st lines differ - expected: '962956728', found: '962956728998754953977366255998...9035...
Test #8:
score: 0
Wrong Answer
time: 11ms
memory: 2280kb
input:
114 99 904301180 723670161 175578826 302899329 876263107 634901097 423846096 721373971 806404241 133...
output:
9751591269690625209753292829921353115287655749691700048109739019938667239833601459682082509924647679...
result:
wrong answer 1st lines differ - expected: '390753698', found: '975159126969062520975329282992...2817...
Test #9:
score: 0
Wrong Answer
time: 22ms
memory: 2448kb
input:
114 89 601946180 609615757 522264444 586864465 274293132 547004323 60456078 441379556 424576145 3821...
output:
9981654159584745369763780909974589418800095989951082539842818978510602439290939529644123179988482379...
result:
wrong answer 1st lines differ - expected: '547004323', found: '998165415958474536976378090997...4212...
Test #10:
score: 0
Wrong Answer
time: 25ms
memory: 2304kb
input:
114 65 244262631 583206342 624605243 567485985 747203802 287784693 265222799 799162659 162367770 127...
output:
9892499929852415919863322519827626058881598754253583869814281719993058259718417549812617419996141239...
result:
wrong answer 1st lines differ - expected: '567485985', found: '989249992985241591986332251982...9136...