結果
問題 | No.1738 What's in the box? |
ユーザー |
![]() |
提出日時 | 2023-04-01 18:59:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 602 ms |
コンパイル使用メモリ | 69,492 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 11:12:31 |
合計ジャッジ時間 | 2,238 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 70 |
ソースコード
#include<iostream>#include<vector>#define ll long longusing namespace std;int main() {ll n, m;cin >> n >> m;vector<ll> w(n);ll sum = 0;for (int i = 0; i < n; i++) {cin >> w[i];sum += w[i];}for (int i = 0; i < n; i++) {if (i) cout << " ";if (sum != 0) cout << w[i] * m / sum;else cout << 0;}cout << endl;return 0;}