ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#187471 | #3367. 金钱游戏 | 0x3f | 100 | 222ms | 2812kb | C++11 | 790b | 2023-10-02 09:56:45 | 2023-10-02 12:35:25 |
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n';
#define int long long
typedef pair<int, int> PII;
int read() {
int x = 0;
char c = getchar();
while (c < '0' || c > '9') {
c = getchar();
}
while (c >= '0' && c <= '9')
x = x * 10 + c - '0', c = getchar();
return x;
}
void write(int x) {
if (x < 0)
putchar('-'), x = -x;
if (x > 9)
write(x / 10);
putchar(x % 10 + '0');
}
void print(int x, char c) { write(x), putchar(c); }
int n;
long double arr[100010] ,sum;
signed main() {
scanf("%lld", &n);
for (int i = 1; i <= n; i++) {
scanf("%Lf", arr + i);
sum += arr[i];
}
long double cur = sum / (n + 1);
printf("%.10Lf ", cur * 2);
for (int i = 1; i < n; i++) {
printf("%.10Lf ", cur);
}
puts("");
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
10 510323 574591 208978 707467 367879 857748 482410 238768 367444 416195
output:
860327.8181818182 430163.9090909091 430163.9090909091 430163.9090909091 430163.9090909091 430163.909...
result:
ok 10 numbers
Test #2:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
10 2 4 1 1 2 1 3 5 2 3
output:
4.3636363636 2.1818181818 2.1818181818 2.1818181818 2.1818181818 2.1818181818 2.1818181818 2.1818181...
result:
ok 10 numbers
Test #3:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
100 283397 377774 494372 487546 143741 314831 934818 229251 78798 395137 407818 18761 516178 734330 ...
output:
848873.9009900990 424436.9504950495 424436.9504950495 424436.9504950495 424436.9504950495 424436.950...
result:
ok 100 numbers
Test #4:
score: 10
Accepted
time: 0ms
memory: 1248kb
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.0792079208 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039...
result:
ok 100 numbers
Test #5:
score: 10
Accepted
time: 1ms
memory: 1272kb
input:
1000 752085 536931 226066 866464 865683 685497 869505 833061 583665 542381 226489 183898 682629 5848...
output:
1019649.5684315684 509824.7842157842 509824.7842157842 509824.7842157842 509824.7842157842 509824.78...
result:
ok 1000 numbers
Test #6:
score: 10
Accepted
time: 0ms
memory: 1264kb
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.0219780220 3.0109890110 3.0109890110 3.0109890110 3.0109890110 3.0109890110 3.0109890110 3.0109890...
result:
ok 1000 numbers
Test #7:
score: 10
Accepted
time: 11ms
memory: 1412kb
input:
10000 555267 855028 164928 642327 322766 137905 892693 768608 595311 65776 289777 973757 430764 3285...
output:
989682.6177382262 494841.3088691131 494841.3088691131 494841.3088691131 494841.3088691131 494841.308...
result:
ok 10000 numbers
Test #8:
score: 10
Accepted
time: 9ms
memory: 1412kb
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.8914108589 131.9457054295 131.9457054295 131.9457054295 131.9457054295 131.9457054295 131.945705...
result:
ok 10000 numbers
Test #9:
score: 10
Accepted
time: 105ms
memory: 2812kb
input:
100000 779832 554019 543847 331565 726136 264080 431095 49283 742555 692958 230722 850608 314016 458...
output:
1001386.0304596954 500693.0152298477 500693.0152298477 500693.0152298477 500693.0152298477 500693.01...
result:
ok 100000 numbers
Test #10:
score: 10
Accepted
time: 96ms
memory: 2812kb
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.3947660523 591.6973830262 591.6973830262 591.6973830262 591.6973830262 591.6973830262 591.69738...
result:
ok 100000 numbers
Extra Test:
score: 0
Extra Test Passed