結果

問題 No.1738 What's in the box?
ユーザー ripity
提出日時 2021-11-12 21:56:41
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 605 bytes
コンパイル時間 2,447 ms
コンパイル使用メモリ 75,104 KB
実行使用メモリ 43,916 KB
最終ジャッジ日時 2024-11-25 18:21:45
合計ジャッジ時間 15,786 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 68 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        long M = sc.nextInt();
        long[] W = new long[(int)N];
        long wsum = 0;
        for( int i = 0; i < N; i++ ) {
            W[i] = sc.nextInt();
            wsum += W[i];
        }
        
        for( int i = 0; i < N; i++ ) {
            System.out.print((M*W[i])/wsum);
            if( i < N-1 ) System.out.print(" ");
        }
        
        System.out.println();
        
    }
    
}
0