結果

問題 No.1808 Fullgold Alchemist
ユーザー 👑 ygussany
提出日時 2021-12-29 14:08:56
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-03 21:35:42
合計ジャッジ時間 3,030 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

void chmin(long long* a, long long b)
{
	if (*a > b) *a = b;
}

int main()
{
	int i, N, M, A[200001];
	scanf("%d %d", &N, &M);
	for (i = 1; i <= N; i++) scanf("%d", &(A[i]));
	
	long long sum = 0, ans = A[1];
	for (i = 1; i <= N; i++) {
		sum += A[i];
		chmin(&ans, sum / i / M);
	}
	printf("%lld\n", ans);
	fflush(stdout);
	return 0;
}
0