結果

問題 No.1738 What's in the box?
ユーザー 👑 CleyL
提出日時 2022-01-18 00:15:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 68,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 13:03:26
合計ジャッジ時間 2,372 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 70
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    long long n,k;cin>>n>>k;
    vector<long long> A(n);
    long long sm  = 0;
    for(int i = 0; n > i; i++){
        cin>>A[i];
        sm += A[i];
    }
    for(int i = 0; n > i; i++){
        cout << (sm==0?0:k*A[i]/sm);
        if(i+1 != n)cout << " ";
    }
    cout << endl;
    
}
0