結果
| 問題 |
No.1673 Lamps on a line
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2021-09-10 21:56:34 |
| 言語 | cLay (20241019-1) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 361 bytes |
| コンパイル時間 | 3,124 ms |
| コンパイル使用メモリ | 176,840 KB |
| 実行使用メモリ | 16,768 KB |
| 最終ジャッジ日時 | 2024-07-05 15:27:18 |
| 合計ジャッジ時間 | 4,265 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
ソースコード
struct S{
int f,x,y;
};
inline
S segtree_ph_func(S a,S b){
return {a.f^b.f,(b.f?a.y:a.x)+b.x,(b.f?a.x:a.y)+b.y};
}
{
segtree_ph<S>t;
ll@n,@q;
t.walloc(n+2,1);
rep(i,n+2){
t[i]={0,0,1};
}
t.build();
rep(q){
ll@l,@r;
{
S s=t[l-1];
s.f^=1;
t.change(l-1,s);
}
{
S s=t[r];
s.f^=1;
t.change(r,s);
}
wt(t.get(0,n+2).x);
}
}
tails