QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#615443 | #9355. Keeping Rabbits | sanbi52 | AC ✓ | 320ms | 4572kb | C++17 | 575b | 2024-10-05 18:39:17 | 2024-10-05 18:39:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
int n, k;
cin >> n >> k;
vector<double> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
double sum = accumulate(a.begin(), a.end(), 0.);
for(int i = 0; i < n; i++){
cout << a[i] + 1. * k * a[i] / sum << " \n"[i == n - 1];
}
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(6);
cout << fixed;
int t;
cin >> t;
while(t--)solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4008kb
input:
3 1 1 2 2 2 1 3 3 2 1 1 1
output:
3.000000 1.500000 4.500000 1.666667 1.666667 1.666667
result:
ok 6 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
10 10 5 6 9 4 4 4 7 6 2 8 7 10 3 9 4 10 4 2 8 8 6 4 7 10 2 2 5 9 4 9 4 2 7 5 9 10 5 9 1 2 1 10 10 7 9 7 1 10 6 8 3 1 10 5 3 1 6 3 10 10 10 5 9 1 7 10 7 6 6 4 4 10 6 1 7 9 5 1 1 6 3 6 5 10 7 5 6 9 1 9 7 1 1 4 5 10 3 4 10 3 3 10 9 3 6 9 10 10 6 5 5 1 2 4 6 8 1 8 2
output:
6.526316 9.789474 4.350877 4.350877 4.350877 7.614035 6.526316 2.175439 8.701754 7.614035 9.435484 4.193548 10.483871 4.193548 2.096774 8.387097 8.387097 6.290323 4.193548 7.338710 2.071429 5.178571 9.321429 4.142857 9.321429 4.142857 2.071429 7.250000 5.178571 9.321429 9.789474 1.087719 2.175439 1....
result:
ok 100 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
10 10 2 18 23 74 43 31 61 59 9 82 39 10 6 82 44 26 99 29 100 24 45 14 8 10 3 10 76 15 14 73 94 48 83 84 20 10 1 35 20 48 6 17 75 57 78 76 39 10 9 13 92 32 23 32 93 13 38 34 64 10 9 45 41 26 90 96 9 20 37 93 14 10 9 81 3 56 89 58 30 21 2 93 28 10 4 69 4 11 77 81 24 19 70 4 85 10 8 5 39 89 36 82 37 12...
output:
18.082005 23.104784 74.337130 43.195900 31.141230 61.277904 59.268793 9.041002 82.373576 39.177677 83.044586 44.560510 26.331210 100.261146 29.369427 101.273885 24.305732 45.573248 14.178344 8.101911 10.058027 76.441006 15.087041 14.081238 73.423598 94.545455 48.278530 83.481625 84.487427 20.116054 ...
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 1ms
memory: 3876kb
input:
10 100 28 54 29 35 99 52 7 52 91 49 4 71 33 22 90 11 73 28 13 43 64 26 47 53 56 32 76 40 80 90 84 18 90 24 96 81 66 82 21 75 58 46 52 45 38 36 82 66 33 4 54 2 57 43 9 64 43 72 10 1 31 80 89 49 100 35 61 44 45 51 51 39 80 80 11 31 95 65 59 81 43 81 2 46 60 90 65 83 55 52 93 80 66 61 29 23 99 2 64 22 ...
output:
54.288220 29.154785 35.186809 99.528403 52.277545 7.037362 52.277545 91.485703 49.261533 4.021350 71.378955 33.176134 22.117423 90.480366 11.058711 73.389630 28.149447 13.069386 43.229508 64.341594 26.138772 47.250858 53.282882 56.298894 32.170797 76.405642 40.213496 80.426992 90.480366 84.448342 18...
result:
ok 1000 numbers
Test #5:
score: 0
Accepted
time: 320ms
memory: 4572kb
input:
1005 89 48 24 95 46 14 50 35 66 24 31 84 66 39 16 80 14 78 49 46 8 19 2 33 97 37 40 85 13 19 51 58 24 87 87 69 77 62 65 5 10 5 15 75 12 32 35 24 13 90 64 89 71 22 94 31 70 93 38 89 56 26 78 56 74 32 28 52 35 61 87 17 1 54 2 88 62 34 74 27 47 18 12 57 88 39 37 76 36 24 31 89 70 71 4 27 56 36 65 33 6 ...
output:
24.275862 96.091954 46.528736 14.160920 50.574713 35.402299 66.758621 24.275862 31.356322 84.965517 66.758621 39.448276 16.183908 80.919540 14.160920 78.896552 49.563218 46.528736 8.091954 19.218391 2.022989 33.379310 98.114943 37.425287 40.459770 85.977011 13.149425 19.218391 51.586207 58.666667 24...
result:
ok 589000 numbers
Extra Test:
score: 0
Extra Test Passed