結果
| 問題 | No.801 エレベーター |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-11-03 15:08:26 |
| 言語 | Fix (1.6.0 + cp-library + minilib) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 1,930 bytes |
| 記録 | |
| コンパイル時間 | 13,571 ms |
| コンパイル使用メモリ | 681,692 KB |
| 実行使用メモリ | 9,908 KB |
| 最終ジャッジ日時 | 2026-11-03 15:09:35 |
| 合計ジャッジ時間 | 66,669 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 15 |
コンパイルメッセージ
make: 'lib.o' は更新済みです.
ソースコード
module Main;
import BinaryHeap;
import BoolArray;
import CPLib.Arithmetic;
import CPLib.DSegtree;
import CPLib.Graph;
import CPLib.IO;
import CPLib.LSegtree;
import CPLib.UnionFind;
import CPLib.ZP;
import CPLib.Monoid;
import HashMap;
import HashSet;
type Z = ZP P1000000007;
// type Tree =
type Tree = LSegtree (WeightedSum Z) (RangeAdd WeightedSum Z);
main : IO () = (
let cN = *read_i; // 回数
let cM = *read_i; // エレベータの数
let cK = *read_i; // 移動回数
let cLRs = *range(0, cM).fold_m([], |_, cLRs|
let l = *read_i;
let r = *read_i;
let l = l - 1;
cLRs.push_back((l, r)).pure
);
// eval "cLRs = {}".debug_eprintfln((cLRs,));
let t = LSegtree::create(cN) : Tree;
let t = t.set(0, WeightedSum::make_single(zp(1)));
let t = range(0, cK).fold(t, |k, t|
// eval "k = {}, t = {}".debug_eprintfln(
// (
// k,
// range(0, cN).map(|i| t.@(i).@v.@value).to_array
// )
// );
let s = LSegtree::build(fill(cN, make_single(zp(0)))) : Tree;
let s = range(0, cM).fold(s, |m, s|
let (l, r) = cLRs.@(m);
let sum = t.fold(l, r);
// eval "k = {}, m = {}, l = {}, r = {}, sum = {}".debug_eprintfln((k,m,l,r,sum.@v.@value));
// eval "k = {}, before s = {}".debug_eprintfln(
// (
// k,
// range(0, cN).map(|i| s.@(i).@v.@value).to_array
// )
// );
let s = s.act_range(l, r, RangeAdd { a : sum.@v });
// eval "k = {}, aftrer s = {}".debug_eprintfln(
// (
// k,
// range(0, cN).map(|i| s.@(i).@v.@value).to_array
// )
// );
s
);
s
);
let ans = t.@(cN-1);
ans.@v.@value.to_string.println
);