結果
問題 | No.1738 What's in the box? |
ユーザー |
![]() |
提出日時 | 2021-11-12 21:32:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 548 ms |
コンパイル使用メモリ | 64,736 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-25 12:15:58 |
合計ジャッジ時間 | 2,389 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 70 |
ソースコード
#include <iostream>using namespace std;typedef long long ll;int main(){int n;ll m;cin >> n >> m;ll s = 0;ll w[1004];for(int i = 0; i < n; i++){cin >> w[i];s += w[i];}for(int i = 0; i < n; i++){if(m == 0) cout << 0 << " ";else cout << m * w[i] / s << " ";}cout << endl;}