QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602250#9355. Keeping RabbitsSatonAC ✓255ms4512kbC++201.0kb2024-09-30 21:59:072024-09-30 21:59:08

Judging History

你现在查看的是最新测评结果

  • [2024-09-30 21:59:08]
  • 评测
  • 测评结果:AC
  • 用时:255ms
  • 内存:4512kb
  • [2024-09-30 21:59:07]
  • 提交

answer

///by Saton.
#include<bits/stdc++.h>
#define PI acos(-1)
#define fi first
#define se second 
#define sz(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define LL long long
#define ll __int128
#define DD double double
#define LD long double
#define rep(i,a,b) for(LL i = (a);i <= (b);i ++)
#define lep(i,a,b) for(LL i = (a);i >= (b);i --)
#define FLUSH fflush(stdout)
using namespace std;
const int N = 2e5 + 10,mod =  1e9+7,P = 131;
const LL inf = 1e9+10,INF = 1e18+10;
typedef pair<int,int> PII;
typedef pair<LL,int> PLI;
typedef pair<LL,LL> PLL;
LL n,m,k;

void solve() {
    cin >> n >> k;
    vector<LL> a(n+1);
    LL sum = 0;
    rep(i,1,n) cin >> a[i],sum += a[i],k += a[i];
    rep(i,1,n) printf("%.9lf ",(double)a[i]/sum*k);
    printf("\n");
} 

int main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while(T --) { 
        solve();
    }
    // solve();
       
    return 0;
}  
/*   /\_/\
*   (= ._.)
*   / >  \>
*/

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3936kb

input:

3
1 1
2
2 2
1 3
3 2
1 1 1

output:

3.000000000 
1.500000000 4.500000000 
1.666666667 1.666666667 1.666666667 

result:

ok 6 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 3912kb

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.526315789 9.789473684 4.350877193 4.350877193 4.350877193 7.614035088 6.526315789 2.175438596 8.701754386 7.614035088 
9.435483871 4.193548387 10.483870968 4.193548387 2.096774194 8.387096774 8.387096774 6.290322581 4.193548387 7.338709677 
2.071428571 5.178571429 9.321428571 4.142857143 9.3214285...

result:

ok 100 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3900kb

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.082004556 23.104783599 74.337129841 43.195899772 31.141230068 61.277904328 59.268792711 9.041002278 82.373576310 39.177676538 
83.044585987 44.560509554 26.331210191 100.261146497 29.369426752 101.273885350 24.305732484 45.573248408 14.178343949 8.101910828 
10.058027079 76.441005803 15.087040619...

result:

ok 100 numbers

Test #4:

score: 0
Accepted
time: 1ms
memory: 3940kb

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.288219596 29.154784598 35.186808997 99.528402592 52.277544796 7.037361799 52.277544796 91.485703393 49.261532596 4.021349600 71.378955395 33.176134197 22.117422798 90.480365993 11.058711399 73.389630194 28.149447198 13.069386199 43.229508197 64.341593595 26.138772398 47.250857796 53.282882196 56....

result:

ok 1000 numbers

Test #5:

score: 0
Accepted
time: 255ms
memory: 4512kb

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.275862069 96.091954023 46.528735632 14.160919540 50.574712644 35.402298851 66.758620690 24.275862069 31.356321839 84.965517241 66.758620690 39.448275862 16.183908046 80.919540230 14.160919540 78.896551724 49.563218391 46.528735632 8.091954023 19.218390805 2.022988506 33.379310345 98.114942529 37....

result:

ok 589000 numbers

Extra Test:

score: 0
Extra Test Passed