結果

問題 No.1000 Point Add and Array Add
ユーザー tailstails
提出日時 2020-10-01 17:21:46
言語 cLay
(20240104-1)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 2,494 ms
コンパイル使用メモリ 162,432 KB
実行使用メモリ 10,616 KB
最終ジャッジ日時 2023-09-19 01:25:53
合計ジャッジ時間 7,383 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,428 KB
testcase_01 AC 2 ms
7,492 KB
testcase_02 AC 2 ms
7,440 KB
testcase_03 AC 3 ms
7,448 KB
testcase_04 AC 2 ms
7,428 KB
testcase_05 AC 2 ms
7,648 KB
testcase_06 AC 2 ms
7,484 KB
testcase_07 AC 2 ms
7,432 KB
testcase_08 AC 3 ms
7,432 KB
testcase_09 AC 2 ms
7,428 KB
testcase_10 AC 2 ms
7,432 KB
testcase_11 AC 3 ms
7,444 KB
testcase_12 AC 3 ms
7,596 KB
testcase_13 AC 2 ms
7,512 KB
testcase_14 AC 3 ms
7,552 KB
testcase_15 AC 3 ms
7,484 KB
testcase_16 AC 28 ms
10,056 KB
testcase_17 AC 22 ms
9,996 KB
testcase_18 AC 37 ms
10,528 KB
testcase_19 AC 37 ms
10,472 KB
testcase_20 AC 24 ms
10,532 KB
testcase_21 AC 38 ms
10,616 KB
testcase_22 AC 34 ms
10,476 KB
testcase_23 AC 38 ms
10,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll b[2d5];
int n,q,a[2d5],x[2d5],y[2d5];
char c[2d5];
fenwick<int>f;
{
	rd(n,q,a(n),(c,x,y)(q));
	f.walloc(n+1,1);
	rrep(i,q){
		if(c[i]=='A')
			b[x[i]-1]+=(ll)y[i]*f.get(x[i]-1);
		else
			f.add(x[i]-1,1),
			f.add(y[i],-1);
	}
	rep(i,n)b[i]+=(ll)a[i]*f.get(i);
	wt(b(n));
}
0