QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#625065 | #9355. Keeping Rabbits | 53Dawns | AC ✓ | 254ms | 4836kb | C++23 | 1.1kb | 2024-10-09 17:20:04 | 2024-10-09 17:20:05 |
Judging History
answer
#include<bits/stdc++.h>
// #pragma GCC optimize (1)
// #pragma GCC optimize (2)
// #pragma GCC optimize (3)
#define deg(a) cout<<#a<<'='<<a<<"\n"
#define all(a) a.begin(),a.end()
#define lowbit(x) ((x)&(-x))
#define find1(x) (__builtin_popcount(x))
#define pll pair<int,int>
#define int long long
#define endl '\n'
#define ff first
#define ss second
#define lc p<<1
#define rc p<<1|1
using namespace std;
using i64 = long long;
const int N = 2e5 + 10;
const int M = 1e6 + 10;
const int mod1 = 998244353;
const int mod2 = 1e9+7;
const int INF = 0x3f3f3f3f3f3f3f;
const double eps = 1e-10;
void solve(){
int n,m;
cin >> n >> m;
std::vector<double> a(n+1);
int sum = 0;
for(int i = 1 ; i <= n ; i++) {
cin >> a[i];
sum += a[i];
}
for(int i = 1 ; i <= n ; i++) {
a[i] += a[i] / sum * m;
cout << a[i] << " ";
}
cout << endl;
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int kk = 1;
cin >> kk;
while(kk--) {
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 4044kb
input:
3 1 1 2 2 2 1 3 3 2 1 1 1
output:
3 1.5 4.5 1.66667 1.66667 1.66667
result:
ok 6 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3732kb
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.52632 9.78947 4.35088 4.35088 4.35088 7.61404 6.52632 2.17544 8.70175 7.61404 9.43548 4.19355 10.4839 4.19355 2.09677 8.3871 8.3871 6.29032 4.19355 7.33871 2.07143 5.17857 9.32143 4.14286 9.32143 4.14286 2.07143 7.25 5.17857 9.32143 9.78947 1.08772 2.17544 1.08772 10.8772 10.8772 7.61404 9.7894...
result:
ok 100 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3880kb
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.082 23.1048 74.3371 43.1959 31.1412 61.2779 59.2688 9.041 82.3736 39.1777 83.0446 44.5605 26.3312 100.261 29.3694 101.274 24.3057 45.5732 14.1783 8.10191 10.058 76.441 15.087 14.0812 73.4236 94.5455 48.2785 83.4816 84.4874 20.1161 35.0776 20.0443 48.1064 6.0133 17.0377 75.1663 57.1264 78.1729 ...
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 1ms
memory: 3884kb
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.2882 29.1548 35.1868 99.5284 52.2775 7.03736 52.2775 91.4857 49.2615 4.02135 71.379 33.1761 22.1174 90.4804 11.0587 73.3896 28.1494 13.0694 43.2295 64.3416 26.1388 47.2509 53.2829 56.2989 32.1708 76.4056 40.2135 80.427 90.4804 84.4483 18.0961 90.4804 24.1281 96.5124 81.4323 66.3523 82.4377 21.112...
result:
ok 1000 numbers
Test #5:
score: 0
Accepted
time: 254ms
memory: 4836kb
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.2759 96.092 46.5287 14.1609 50.5747 35.4023 66.7586 24.2759 31.3563 84.9655 66.7586 39.4483 16.1839 80.9195 14.1609 78.8966 49.5632 46.5287 8.09195 19.2184 2.02299 33.3793 98.1149 37.4253 40.4598 85.977 13.1494 19.2184 51.5862 58.6667 24.2759 88 88 69.7931 77.8851 62.7126 65.7471 5.05747 10.1149 ...
result:
ok 589000 numbers
Extra Test:
score: 0
Extra Test Passed