結果
問題 | No.1738 What's in the box? |
ユーザー |
|
提出日時 | 2022-08-20 09:51:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 701 bytes |
コンパイル時間 | 2,098 ms |
コンパイル使用メモリ | 195,212 KB |
最終ジャッジ日時 | 2025-01-31 01:56:59 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 70 |
ソースコード
typedef long long ll; typedef long double ld; #include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ll n; ld m; std::cin >> n>>m; vector<ld> w(n); ld sum = 0; for (int i = 0; i < n; i++) { std::cin >> w[i]; sum += w[i]; } if(m==0){ for (int i = 0; i < n; i++) { std::cout << 0; if(i<n-1){ std::cout << " "; } } std::cout << std::endl; return 0; } ld ko = sum/m; for (int i = 0; i < n; i++) { std::cout << lroundl(w[i]/ko); if(i<n-1){ std::cout << " "; } } std::cout << std::endl; }