QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#704871 | #1772. Antenna Analysis | TheZone | AC ✓ | 39ms | 9532kb | C++20 | 460b | 2024-11-02 21:20:54 | 2024-11-02 21:20:55 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
long long n,c;
cin>>n>>c;
vector<long long> a(n+5),ans(n+5);
long long pmax=-1e18,pmin=1e18,nmax=-1e18,nmin=1e18;
for(int i=1;i<=n;i++)
{
cin>>a[i];
pmax=max(pmax,c*i+a[i]);
nmin=min(nmin,a[i]-c*i);
ans[i]=max({abs(pmax-(c*i+a[i])),abs(nmin-(a[i]-c*i))});
}
for(int i=1;i<=n;i++)
{
cout<<ans[i]<<" \n"[i==n];
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 35ms
memory: 9332kb
input:
400000 1 647761 970495 559170 744364 383620 598715 614243 767448 173736 812856 864419 348955 402344 665714 827970 377326 966501 322577 410572 730984 214902 798529 688157 905792 956622 382598 114598 446157 860292 666053 418109 943852 68518 529944 733174 700577 365012 931483 423193 422964 840552 77337...
output:
0 322733 411324 226129 586872 371776 356247 383825 796752 639119 690681 621530 568140 491973 654228 593155 792757 647902 559906 557237 755574 624780 514407 732041 782870 587873 855872 524312 745692 551452 552357 829249 901946 461425 664654 632056 605448 862960 547265 547493 772026 704845 770402 6445...
result:
ok single line: '0 322733 411324 226129 586872 ...683 680267 587103 866107 506886'
Test #2:
score: 0
Accepted
time: 27ms
memory: 9316kb
input:
400000 2 340906 358332 510304 453905 871150 149865 511906 396216 410868 139398 298893 659616 110552 177228 568415 67537 807854 754280 995986 532913 513697 9014 570976 873260 807906 94838 949592 703512 963036 259332 855950 825429 715005 107659 143017 320936 372259 306465 31084 30955 267983 201015 261...
output:
0 17424 169394 112993 530236 721283 362039 474928 460274 731742 572245 520214 760582 693904 457859 803591 740315 686739 928443 465368 482285 986966 561960 864242 798886 901134 940568 694486 954008 736632 846918 816395 705969 888297 852937 675016 623691 689483 964862 964989 727959 794925 734107 95560...
result:
ok single line: '0 17424 169394 112993 530236 7...998 653372 671242 878182 600020'
Test #3:
score: 0
Accepted
time: 39ms
memory: 9528kb
input:
400000 5 526366 258693 717812 272316 758611 731878 472269 888099 379660 879274 302458 290852 468593 92587 723622 903946 686245 376282 762795 847710 60674 520129 665400 780549 274856 24531 198148 297727 325184 903207 866656 981531 754414 456766 295654 669170 864276 322101 920943 912071 32596 92251 36...
output:
0 267668 459114 445491 499903 473165 286332 629376 508434 620541 585626 597227 419481 795482 631030 811349 593643 527654 670183 755093 843247 459450 604716 719860 629045 879365 705743 606159 578697 878656 842100 956970 729848 524755 685862 644589 839690 659400 896347 887470 948890 889230 614797 9365...
result:
ok single line: '0 267668 459114 445491 499903 ...873 657917 948166 940134 658020'
Test #4:
score: 0
Accepted
time: 31ms
memory: 9352kb
input:
400000 100 107748 890810 453408 775248 870167 41898 866886 851485 872848 939346 423274 318661 714945 852369 135948 9468 769940 542910 403700 417390 646325 653940 870068 961906 988544 443618 546330 703152 479885 404320 238340 556607 277351 417115 2086 850980 226744 494354 62234 691759 979622 732773 6...
output:
0 782962 437302 667200 762019 848512 824888 809387 830650 897048 515972 620485 672347 809671 802898 929278 760372 533242 534746 520956 636357 643872 859900 951638 978176 544826 535762 692484 508259 583724 749604 545539 710393 570529 985458 848794 760600 492890 924910 689173 976936 729987 611812 6714...
result:
ok single line: '0 782962 437302 667200 762019 ...407 512753 848860 719796 960592'
Test #5:
score: 0
Accepted
time: 28ms
memory: 9464kb
input:
400000 1000000 37536 471634 510902 568241 708988 859256 452387 895138 172648 123934 247337 580693 767494 826690 91835 780916 922235 955066 181068 210450 129981 959041 568702 118967 805436 621659 742984 417671 54528 693163 60467 110471 330041 945894 621098 532377 314260 715443 112330 12846 900546 666...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0'
Test #7:
score: 0
Accepted
time: 31ms
memory: 9456kb
input:
400000 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...004 700004 800002 700001 800000'
Test #8:
score: 0
Accepted
time: 36ms
memory: 9532kb
input:
400000 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 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
Test #9:
score: 0
Accepted
time: 35ms
memory: 9440kb
input:
400000 1000000 399999 399998 399997 399996 399995 399994 399993 399992 399991 399990 399989 399988 399987 399986 399985 399984 399983 399982 399981 399980 399979 399978 399977 399976 399975 399974 399973 399972 399971 399970 399969 399968 399967 399966 399965 399964 399963 399962 399961 399960 39995...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'