結果
| 問題 | No.1738 What's in the box? |
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2021-11-12 21:56:41 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 605 bytes |
| 記録 | |
| コンパイル時間 | 2,505 ms |
| コンパイル使用メモリ | 82,232 KB |
| 実行使用メモリ | 46,188 KB |
| 最終ジャッジ日時 | 2026-05-20 08:25:36 |
| 合計ジャッジ時間 | 12,273 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 68 RE * 2 |
ソースコード
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();
}
}
ripity