結果
問題 |
No.77 レンガのピラミッド
|
ユーザー |
![]() |
提出日時 | 2017-05-03 11:55:14 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 1,988 ms / 5,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 1,798 ms |
コンパイル使用メモリ | 170,752 KB |
実行使用メモリ | 13,948 KB |
最終ジャッジ日時 | 2024-09-14 07:02:39 |
合計ジャッジ時間 | 6,229 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
コンパイルメッセージ
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
ソースコード
import Data.List fork f (x,y) = (f x, f y) main = do n <- readLn as <- map read . words <$> getLine print (pyramid n as) pyramid n as = length ((ipos n as) \\ (ppos (sum as))) ipos n as = [(x,y) | x <- [1 .. n], y <- [1 .. as!!(x-1)]] ppos x = do let w = floor (sqrt (fromIntegral x)) iy <- [1 .. w] ix <- [iy .. 2*w-iy] return (ix,iy)