結果

問題 No.1738 What's in the box?
ユーザー merlinmerlin
提出日時 2021-11-12 22:06:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 716 bytes
コンパイル時間 2,618 ms
コンパイル使用メモリ 76,012 KB
実行使用メモリ 52,188 KB
最終ジャッジ日時 2024-05-04 08:55:22
合計ジャッジ時間 9,303 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
50,636 KB
testcase_01 AC 61 ms
50,696 KB
testcase_02 AC 59 ms
50,916 KB
testcase_03 AC 72 ms
51,228 KB
testcase_04 AC 73 ms
51,136 KB
testcase_05 AC 76 ms
51,132 KB
testcase_06 AC 84 ms
51,012 KB
testcase_07 WA -
testcase_08 AC 85 ms
51,240 KB
testcase_09 AC 88 ms
51,392 KB
testcase_10 AC 71 ms
51,228 KB
testcase_11 AC 72 ms
51,072 KB
testcase_12 AC 76 ms
51,300 KB
testcase_13 AC 72 ms
51,108 KB
testcase_14 AC 74 ms
50,896 KB
testcase_15 AC 64 ms
50,612 KB
testcase_16 AC 65 ms
51,048 KB
testcase_17 AC 59 ms
50,884 KB
testcase_18 WA -
testcase_19 AC 61 ms
50,948 KB
testcase_20 AC 62 ms
50,784 KB
testcase_21 WA -
testcase_22 AC 57 ms
50,672 KB
testcase_23 AC 60 ms
50,732 KB
testcase_24 AC 74 ms
50,740 KB
testcase_25 AC 64 ms
51,112 KB
testcase_26 AC 61 ms
50,752 KB
testcase_27 WA -
testcase_28 AC 62 ms
50,784 KB
testcase_29 AC 60 ms
50,680 KB
testcase_30 AC 59 ms
50,728 KB
testcase_31 AC 72 ms
50,968 KB
testcase_32 AC 73 ms
50,952 KB
testcase_33 AC 82 ms
50,848 KB
testcase_34 AC 86 ms
51,152 KB
testcase_35 AC 86 ms
50,972 KB
testcase_36 AC 87 ms
51,324 KB
testcase_37 AC 74 ms
51,164 KB
testcase_38 AC 87 ms
51,344 KB
testcase_39 AC 76 ms
50,980 KB
testcase_40 AC 86 ms
51,104 KB
testcase_41 AC 76 ms
51,300 KB
testcase_42 AC 73 ms
51,288 KB
testcase_43 AC 86 ms
51,228 KB
testcase_44 AC 77 ms
51,224 KB
testcase_45 AC 70 ms
51,184 KB
testcase_46 AC 71 ms
51,164 KB
testcase_47 AC 107 ms
51,104 KB
testcase_48 AC 110 ms
51,324 KB
testcase_49 AC 80 ms
51,000 KB
testcase_50 AC 83 ms
51,160 KB
testcase_51 AC 83 ms
51,260 KB
testcase_52 AC 82 ms
50,956 KB
testcase_53 AC 60 ms
51,012 KB
testcase_54 AC 61 ms
51,024 KB
testcase_55 AC 59 ms
50,604 KB
testcase_56 WA -
testcase_57 AC 57 ms
50,624 KB
testcase_58 AC 68 ms
50,736 KB
testcase_59 AC 63 ms
50,656 KB
testcase_60 AC 64 ms
51,096 KB
testcase_61 AC 66 ms
51,296 KB
testcase_62 AC 65 ms
50,728 KB
testcase_63 AC 61 ms
50,880 KB
testcase_64 AC 60 ms
51,200 KB
testcase_65 AC 61 ms
50,868 KB
testcase_66 WA -
testcase_67 AC 61 ms
50,904 KB
testcase_68 AC 62 ms
50,996 KB
testcase_69 AC 59 ms
50,724 KB
testcase_70 AC 60 ms
50,760 KB
testcase_71 AC 60 ms
50,988 KB
testcase_72 AC 60 ms
50,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int n=Integer.parseInt(s[0]),m=Integer.parseInt(s[1]);
        int a[]=new int[n],i,tot=0;
        s=bu.readLine().split(" ");
        for(i=0;i<n;i++)
        {
            a[i]=Integer.parseInt(s[i]);
            tot+=a[i];
        }

        for(i=0;i<n;i++)
        {
            long ans=0;
            if(a[i]!=0) ans=1l*a[i]*m/tot;
            sb.append(ans+" ");
        }
        System.out.println(sb);
    }
}
0