結果

問題 No.77 レンガのピラミッド
ユーザー aimyaimy
提出日時 2017-05-03 11:55:14
言語 Haskell
(9.8.2)
結果
AC  
実行時間 1,911 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 160,676 KB
実行使用メモリ 16,388 KB
最終ジャッジ日時 2023-10-12 07:54:26
合計ジャッジ時間 5,251 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,008 KB
testcase_01 AC 3 ms
6,900 KB
testcase_02 AC 2 ms
6,952 KB
testcase_03 AC 3 ms
6,896 KB
testcase_04 AC 2 ms
6,988 KB
testcase_05 AC 3 ms
6,996 KB
testcase_06 AC 1,911 ms
16,388 KB
testcase_07 AC 3 ms
7,000 KB
testcase_08 AC 362 ms
15,500 KB
testcase_09 AC 63 ms
13,160 KB
testcase_10 AC 42 ms
13,192 KB
testcase_11 AC 52 ms
13,244 KB
testcase_12 AC 162 ms
15,004 KB
testcase_13 AC 162 ms
16,016 KB
testcase_14 AC 213 ms
15,596 KB
testcase_15 AC 42 ms
13,208 KB
testcase_16 AC 32 ms
12,652 KB
testcase_17 AC 12 ms
11,104 KB
testcase_18 AC 193 ms
15,444 KB
testcase_19 AC 4 ms
8,380 KB
testcase_20 AC 5 ms
9,292 KB
testcase_21 AC 92 ms
14,368 KB
testcase_22 AC 42 ms
13,276 KB
testcase_23 AC 92 ms
14,936 KB
testcase_24 AC 3 ms
7,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

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)
0