QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#40329 | #889. Wandering | yzhang | AC ✓ | 4ms | 3736kb | C++ | 843b | 2022-07-20 13:49:14 | 2022-07-20 13:49:15 |
Judging History
answer
//μ's forever
#include <bits/stdc++.h>
//#define getchar nc
using namespace std;
inline char nc(){
static char buf[100000],*p1=buf,*p2=buf;
return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read()
{
register int x=0,f=1;register char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
return x*f;
}
inline void write(register int x)
{
if(!x)putchar('0');if(x<0)x=-x,putchar('-');
static int sta[20];register int tot=0;
while(x)sta[tot++]=x%10,x/=10;
while(tot)putchar(sta[--tot]+48);
}
int n;
double ans;
int main()
{
n=read();
for(int i=1;i<=n;++i){
int x=read();
ans+=1.0*x*x/2.0;
}
printf("%.6lf\n",ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3576kb
input:
3 1 2 3
output:
7.000000
result:
ok found '7.0000000', expected '7.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
1 123
output:
7564.500000
result:
ok found '7564.5000000', expected '7564.5000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3736kb
input:
10 840 863 749 988 219 733 810 27 200 143
output:
2145021.000000
result:
ok found '2145021.0000000', expected '2145021.0000000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3692kb
input:
100 984 118 791 34 808 374 842 870 41 35 256 355 651 217 571 364 504 392 513 549 754 63 713 237 406 458 646 380 899 208 243 681 829 952 562 280 125 835 345 613 491 144 96 910 540 461 707 216 421 17 275 395 847 493 173 748 304 968 508 356 779 857 981 739 723 190 979 36 697 725 10 758 873 159 16 191 5...
output:
17159432.000000
result:
ok found '17159432.0000000', expected '17159432.0000000', error '0.0000000'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
1000 14 20 832 970 60 234 551 41 622 631 984 920 119 914 951 4 559 323 738 554 474 543 510 158 765 964 876 321 646 536 148 835 967 149 411 384 552 446 721 294 782 696 579 609 890 150 766 677 177 756 108 886 635 341 578 7 112 204 519 730 595 726 697 284 124 525 334 464 863 126 645 906 34 674 33 8 730...
output:
163131942.500000
result:
ok found '163131942.5000000', expected '163131942.5000000', error '0.0000000'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
10000 675 246 610 844 41 83 255 558 367 206 83 39 435 492 297 954 7 868 272 678 299 609 120 205 960 47 417 939 410 285 573 748 479 424 98 595 170 298 277 865 97 471 60 534 737 556 550 548 814 950 542 21 131 129 451 255 899 516 50 194 552 989 674 115 285 836 9 822 957 289 427 89 422 301 981 809 116 2...
output:
1657666631.000000
result:
ok found '1657666631.0000000', expected '1657666631.0000000', error '0.0000000'
Test #7:
score: 0
Accepted
time: 3ms
memory: 3708kb
input:
50000 194 888 546 498 563 860 681 818 934 753 995 254 820 886 322 24 788 546 732 771 703 236 937 204 731 289 898 84 969 962 691 550 247 131 495 454 979 522 951 272 984 841 17 102 880 349 491 193 953 401 922 109 454 72 523 326 641 706 545 89 552 598 193 221 718 320 572 167 353 421 10 44 917 870 391 7...
output:
8317759955.000000
result:
ok found '8317759955.0000000', expected '8317759955.0000000', error '0.0000000'
Test #8:
score: 0
Accepted
time: 4ms
memory: 3692kb
input:
50000 212 703 854 923 111 232 803 411 539 605 821 299 640 43 491 509 129 799 879 477 248 602 35 786 570 527 221 414 845 163 689 676 441 789 897 418 49 806 900 698 463 468 268 642 992 846 554 244 564 18 339 587 570 224 651 560 215 802 438 953 239 864 253 817 286 61 864 409 821 507 662 219 284 724 712...
output:
8351626205.500000
result:
ok found '8351626205.5000000', expected '8351626205.5000000', error '0.0000000'