結果
| 問題 |
No.876 Range Compress Query
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2019-09-06 22:54:47 |
| 言語 | cLay (20241019-1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 303 bytes |
| コンパイル時間 | 4,044 ms |
| コンパイル使用メモリ | 179,512 KB |
| 実行使用メモリ | 15,332 KB |
| 最終ジャッジ日時 | 2024-07-05 13:23:27 |
| 合計ジャッジ時間 | 6,540 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 WA * 6 |
ソースコード
segtree<ll> t;
ll n,q,a[1d5];
ll b,l,r,x;
{
rd(n,q,a(n));
t.walloc(n,1);
rep(i,n-1)t[i]=(a[i]=a[i+1]-a[i])!=0;
t.build();
rep(q){
rd(b,l,r);
--l; --r;
if(b==1){
rd(x);
if(l>0) t.change(l-1,l,(a[l-1]+=x)!=0);
t.change(r,r+1,(a[r]-=x)!=0);
}else{
wt(1ll+t.getSum(l,r));
}
}
}
tails