結果

問題 No.1738 What's in the box?
ユーザー V_Melville
提出日時 2021-11-13 19:03:43
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 367 bytes
コンパイル時間 2,362 ms
コンパイル使用メモリ 246,896 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 18:38:54
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 68 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using std::cin;
using std::cout;
using std::vector;
using ll = long long;

int main() {
	int n, m;
	cin >> n >> m;
	
	vector<ll> w(n);
	rep(i, n) cin >> w[i];
	
	ll s = 0;
	rep(i, n) s += w[i];
	
	vector<int> a(n);
	rep(i, n) a[i] = w[i] * m / s;
	rep(i, n) cout << a[i] << ' ';
	
	return 0;
}
0