結果

問題 No.865 24時間降水量
ユーザー tailstails
提出日時 2021-03-23 17:29:04
言語 cLay
(20231016-1)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 163,980 KB
実行使用メモリ 6,932 KB
最終ジャッジ日時 2023-09-19 02:18:20
合計ジャッジ時間 4,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,384 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 21 ms
6,932 KB
testcase_16 AC 22 ms
6,896 KB
testcase_17 AC 22 ms
6,836 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,a[2d5],q,t,v;
ll b,s;
void f(ll x,ll y){
	s=0;
	rep(i,max(0,x-24),x){
		s+=a[i];
	}
	rep(i,x,min(n,y)){
		s+=a[i];
		if(i-24>=0) s-=a[i-24];
		if(b<s) b=s;
	}
}
{
	rd(n,a(n),q);
	f(0,n);
	rep(q){
		rd(t,v);
		a[--t]=v;
		f(t,t+24);
		wt(b);
	}
}
0