UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187455#3367. 金钱游戏illness0412100230ms2076kbC++555b2023-10-02 09:47:372023-10-02 12:35:00

answer

#include <iostream>
#include <cstdio>
using namespace std;

int fast_pow(int b, int e){
	if(e==0) return 1;
	else if(e==1) return b;
	else{
		if(e%2==0) return fast_pow(b, e/2)*fast_pow(b,e/2);
		else return fast_pow(b, (e-1)/2)*fast_pow(b, (e-1)/2)*b;
	}
}

int main(){
	int n;
	double a[100005];
	long long s=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
		long long x=a[i]*fast_pow(10,7);
		s+=x;
	}
	double a0=(double)(s/(n+1))/fast_pow(10,7);
	for(int i=0;i<n;i++){
		printf("%.6f ", (i==0)?a0*2:a0);
	}
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1300kb

input:

10
510323 574591 208978 707467 367879 857748 482410 238768 367444 416195

output:

860327.818182 430163.909091 430163.909091 430163.909091 430163.909091 430163.909091 430163.909091 43...

result:

ok 10 numbers

Test #2:

score: 10
Accepted
time: 0ms
memory: 1296kb

input:

10
2 4 1 1 2 1 3 5 2 3

output:

4.363636 2.181818 2.181818 2.181818 2.181818 2.181818 2.181818 2.181818 2.181818 2.181818 

result:

ok 10 numbers

Test #3:

score: 10
Accepted
time: 0ms
memory: 1304kb

input:

100
283397 377774 494372 487546 143741 314831 934818 229251 78798 395137 407818 18761 516178 734330 ...

output:

848873.900990 424436.950495 424436.950495 424436.950495 424436.950495 424436.950495 424436.950495 42...

result:

ok 100 numbers

Test #4:

score: 10
Accepted
time: 0ms
memory: 1296kb

input:

100
5 3 4 3 3 5 1 4 1 5 5 4 2 5 2 4 2 2 5 2 3 4 3 3 1 3 1 5 4 5 4 2 3 1 4 2 2 3 4 5 2 5 2 2 1 2 1 4 ...

output:

6.079208 3.039604 3.039604 3.039604 3.039604 3.039604 3.039604 3.039604 3.039604 3.039604 3.039604 3...

result:

ok 100 numbers

Test #5:

score: 10
Accepted
time: 0ms
memory: 1308kb

input:

1000
752085 536931 226066 866464 865683 685497 869505 833061 583665 542381 226489 183898 682629 5848...

output:

1019649.568431 509824.784216 509824.784216 509824.784216 509824.784216 509824.784216 509824.784216 5...

result:

ok 1000 numbers

Test #6:

score: 10
Accepted
time: 1ms
memory: 1304kb

input:

1000
5 4 4 5 2 2 1 1 2 4 4 5 4 4 5 4 2 1 1 5 5 3 5 2 4 3 2 2 5 4 4 3 2 1 1 1 2 5 3 4 4 5 2 5 4 1 5 4...

output:

6.021978 3.010989 3.010989 3.010989 3.010989 3.010989 3.010989 3.010989 3.010989 3.010989 3.010989 3...

result:

ok 1000 numbers

Test #7:

score: 10
Accepted
time: 13ms
memory: 1380kb

input:

10000
555267 855028 164928 642327 322766 137905 892693 768608 595311 65776 289777 973757 430764 3285...

output:

989682.617738 494841.308869 494841.308869 494841.308869 494841.308869 494841.308869 494841.308869 49...

result:

ok 10000 numbers

Test #8:

score: 10
Accepted
time: 7ms
memory: 1384kb

input:

10000
2 5 2 1 2 1 2 5 2 3 2 4 2 5 5 2 4 4 4 4 1 2 4 3 4 3 2 5 3 5 2 4 3 5 5 2 4 5 4 4 5 1 4 1 4 4 5 ...

output:

263.891411 131.945705 131.945705 131.945705 131.945705 131.945705 131.945705 131.945705 131.945705 1...

result:

ok 10000 numbers

Test #9:

score: 10
Accepted
time: 118ms
memory: 2076kb

input:

100000
779832 554019 543847 331565 726136 264080 431095 49283 742555 692958 230722 850608 314016 458...

output:

1001386.030460 500693.015230 500693.015230 500693.015230 500693.015230 500693.015230 500693.015230 5...

result:

ok 100000 numbers

Test #10:

score: 10
Accepted
time: 91ms
memory: 2076kb

input:

100000
3 3 2 1 5 5 5 1 2 5 3 2 4 2 1 5 5 1 5 3 3 5 4 1 2 3 2 3 1 2 4 4 2 5 1 3 4 3 2 3 1 1 5 2 1 3 5...

output:

1183.394766 591.697383 591.697383 591.697383 591.697383 591.697383 591.697383 591.697383 591.697383 ...

result:

ok 100000 numbers

Extra Test:

score: 0
Extra Test Passed