結果

問題 No.1738 What's in the box?
ユーザー bluemeganebluemegane
提出日時 2021-11-13 09:18:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 1,346 ms
コンパイル使用メモリ 63,648 KB
実行使用メモリ 25,552 KB
最終ジャッジ日時 2023-08-17 21:21:51
合計ジャッジ時間 8,710 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,548 KB
testcase_01 AC 62 ms
23,456 KB
testcase_02 AC 63 ms
21,540 KB
testcase_03 AC 71 ms
23,768 KB
testcase_04 AC 70 ms
21,704 KB
testcase_05 AC 70 ms
21,824 KB
testcase_06 AC 70 ms
21,744 KB
testcase_07 AC 69 ms
21,660 KB
testcase_08 AC 69 ms
21,688 KB
testcase_09 AC 69 ms
21,700 KB
testcase_10 AC 70 ms
21,612 KB
testcase_11 AC 70 ms
23,608 KB
testcase_12 AC 70 ms
23,788 KB
testcase_13 AC 63 ms
23,592 KB
testcase_14 AC 62 ms
21,488 KB
testcase_15 AC 62 ms
21,496 KB
testcase_16 AC 63 ms
21,576 KB
testcase_17 AC 63 ms
21,588 KB
testcase_18 AC 62 ms
21,596 KB
testcase_19 AC 63 ms
25,552 KB
testcase_20 AC 62 ms
23,532 KB
testcase_21 AC 61 ms
21,624 KB
testcase_22 AC 62 ms
21,564 KB
testcase_23 AC 63 ms
23,564 KB
testcase_24 AC 69 ms
21,604 KB
testcase_25 AC 70 ms
21,504 KB
testcase_26 AC 63 ms
23,508 KB
testcase_27 AC 63 ms
23,568 KB
testcase_28 AC 63 ms
21,464 KB
testcase_29 AC 62 ms
21,496 KB
testcase_30 AC 62 ms
21,464 KB
testcase_31 AC 64 ms
23,688 KB
testcase_32 AC 71 ms
19,736 KB
testcase_33 AC 69 ms
21,568 KB
testcase_34 AC 69 ms
23,656 KB
testcase_35 AC 70 ms
19,560 KB
testcase_36 AC 70 ms
21,852 KB
testcase_37 AC 69 ms
21,716 KB
testcase_38 AC 69 ms
21,700 KB
testcase_39 AC 70 ms
21,868 KB
testcase_40 AC 70 ms
21,780 KB
testcase_41 AC 71 ms
21,708 KB
testcase_42 AC 70 ms
21,812 KB
testcase_43 AC 70 ms
21,744 KB
testcase_44 AC 70 ms
23,716 KB
testcase_45 AC 70 ms
23,720 KB
testcase_46 AC 69 ms
21,868 KB
testcase_47 AC 69 ms
21,680 KB
testcase_48 AC 69 ms
21,800 KB
testcase_49 AC 70 ms
23,724 KB
testcase_50 AC 71 ms
23,624 KB
testcase_51 AC 71 ms
21,752 KB
testcase_52 AC 70 ms
21,800 KB
testcase_53 AC 64 ms
21,592 KB
testcase_54 AC 64 ms
21,448 KB
testcase_55 AC 62 ms
21,608 KB
testcase_56 AC 62 ms
23,592 KB
testcase_57 AC 63 ms
21,588 KB
testcase_58 AC 63 ms
21,520 KB
testcase_59 AC 62 ms
21,456 KB
testcase_60 AC 62 ms
21,580 KB
testcase_61 AC 62 ms
21,424 KB
testcase_62 AC 62 ms
23,548 KB
testcase_63 AC 64 ms
21,548 KB
testcase_64 AC 63 ms
21,460 KB
testcase_65 AC 62 ms
21,480 KB
testcase_66 AC 64 ms
23,600 KB
testcase_67 AC 62 ms
21,616 KB
testcase_68 AC 63 ms
21,560 KB
testcase_69 AC 62 ms
21,632 KB
testcase_70 AC 63 ms
21,496 KB
testcase_71 AC 61 ms
21,460 KB
testcase_72 AC 63 ms
23,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = long.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var w = Array.ConvertAll(line, long.Parse);
        getAns(n, m, w);
    }
    static void getAns(int n, long m, long[] w)
    {
        var wsum = w.Sum();
        if (wsum == 0) { Console.WriteLine(string.Join(" ", Enumerable.Repeat(0, n))); return; }
        var ans = new long[n];
        for (int i = 0; i < n; i++)
        {
            ans[i] = m * w[i] / wsum;
        }
        Console.WriteLine(string.Join(" ", ans));
    }
}
0