結果
| 問題 |
No.1738 What's in the box?
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2021-11-12 21:28:05 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 546 bytes |
| コンパイル時間 | 1,907 ms |
| コンパイル使用メモリ | 169,484 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-25 12:04:47 |
| 合計ジャッジ時間 | 3,328 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 70 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
vector<int> W(N);
for (int i = 0; i < N; i++){
cin >> W[i];
}
if (M == 0){
for (int i = 0; i < N; i++){
cout << 0;
if (i < N - 1){
cout << ' ';
}
}
cout << endl;
} else {
long long sum = 0;
for (int i = 0; i < N; i++){
sum += W[i];
}
for (int i = 0; i < N; i++){
cout << (long long) W[i] * M / sum;
if (i < N - 1){
cout << ' ';
}
}
cout << endl;
}
}
SSRS