結果

問題 No.1738 What's in the box?
ユーザー goteten
提出日時 2021-11-12 21:42:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 509 bytes
コンパイル時間 1,708 ms
コンパイル使用メモリ 168,192 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 17:39:21
合計ジャッジ時間 3,136 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 68 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
const long long INF = 1LL << 60;
using ll = long long;
using ld = long double;
#define v2d(type,H,W,name,value) vector<vector<type>> name(H,vector<type>(W,value));

int main()
{
  ll N,M;
  cin >> N >> M;

  vector<ll> a(N);
  rep(i,N){
    cin >> a[i];
  }

  ll sum=0;
  rep(i,N) sum+=a[i];

  rep(i,N){
    cout << (a[i]*M)/sum;
    if(i<N-1) cout << " ";
  }
  cout << endl;
}
0