結果
| 問題 | No.1738 What's in the box? |
| コンテスト | |
| ユーザー |
goteten
|
| 提出日時 | 2021-11-12 21:43:51 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 861µs | |
| コード長 | 540 bytes |
| 記録 | |
| コンパイル時間 | 984 ms |
| コンパイル使用メモリ | 183,968 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-15 00:09:25 |
| 合計ジャッジ時間 | 4,266 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 72 |
ソースコード
#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){
if(sum>0) cout << (a[i]*M)/sum;
else cout << 0;
if(i<N-1) cout << " ";
}
cout << endl;
}
goteten