結果
問題 | No.1808 Fullgold Alchemist |
ユーザー |
![]() |
提出日時 | 2024-11-30 16:30:01 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 1,932 ms |
コンパイル使用メモリ | 204,472 KB |
実行使用メモリ | 6,656 KB |
最終ジャッジ日時 | 2024-11-30 16:30:08 |
合計ジャッジ時間 | 4,132 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){int n; ll m; cin >> n >> m;vector<ll> a(n);for(auto& x : a){cin >> x;}vector<ll> b = a;for(int i = 0; i < n - 1; ++i){b[i + 1] += b[i];}ll ans = a[0] / m;for(int i = 0; i < n; ++i){ll x = b[i] / (m * (i + 1));if(ans <= x){continue;}ans = x;}cout << ans << endl;return 0;}