結果
問題 |
No.1808 Fullgold Alchemist
|
ユーザー |
![]() |
提出日時 | 2021-10-04 15:18:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 113 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 762 ms |
コンパイル使用メモリ | 71,140 KB |
最終ジャッジ日時 | 2025-01-24 20:12:50 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <iostream> #include <vector> #define rep(i, l, n) for (int i = (l); i < (n); i++) #define min(a,b) (((a) < (b)) ? (a) : (b)) using namespace std; using ll = long long; template <class T> using V = vector<T>; int main(void) { ll n, m; cin >> n >> m; V<ll> a(n); rep(i, 0, n) { cin >> a[i]; } ll s = a[0]; ll ans = a[0] / m; rep(i, 1, n) { s += a[i]; ans = min(ans, s / (m * (i + 1))); } cout << ans << endl; return 0; }