結果
問題 | No.2803 Bocching Star |
ユーザー |
|
提出日時 | 2024-07-13 22:25:49 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 1,041 ms / 2,000 ms |
コード長 | 874 bytes |
コンパイル時間 | 12,082 ms |
コンパイル使用メモリ | 180,908 KB |
実行使用メモリ | 58,960 KB |
最終ジャッジ日時 | 2024-07-13 22:26:31 |
合計ジャッジ時間 | 26,969 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
LANGUAGEimportData.ByteString.CharByteStringimportqualifiedData.ByteString.CharasBimportData.ListimportData.CharisSpacemain::IO()main = do[n, s] <- fsolve n s <$> f >>= prtwheref = readil B.readInt <$> B.getLinesolve::Int->Int->Int->Intsolve n s ps = f [] spswheresps = sort $ (10 ^ 18, n + 1) : (-(10 ^ 18), 0) : (zip ps [1..])f::Int->IntInt->Intf hs ((p0, _) : (p1, i1) : (p2, i2) : ps)| p1 - p0 > s && p2 - p1 > s = f (i1 : hs) ((p1, i1) : (p2, i2) : ps)| otherwise = f hs ((p1, i1) : (p2, i2) : ps)f hs _ = sort hsprt::Int->IO()prt l = doprint $ length lputStrLn $ unwords $ map show lreadil::Integrala=>ByteString->MaybeaByteString->ByteString->areadil f = unfoldr $ f . B.dropWhile isSpace