結果

問題 No.80 四角形を描こう
ユーザー taktak
提出日時 2018-06-14 12:29:57
言語 F#
(F# 4.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 4,823 ms
コンパイル使用メモリ 156,280 KB
実行使用メモリ 24,984 KB
最終ジャッジ日時 2023-09-13 04:06:31
合計ジャッジ時間 6,773 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
24,972 KB
testcase_01 AC 85 ms
22,972 KB
testcase_02 AC 84 ms
21,056 KB
testcase_03 AC 84 ms
22,920 KB
testcase_04 AC 85 ms
24,984 KB
testcase_05 AC 84 ms
24,892 KB
testcase_06 AC 83 ms
20,992 KB
testcase_07 AC 84 ms
23,048 KB
testcase_08 AC 84 ms
23,048 KB
testcase_09 AC 84 ms
22,892 KB
testcase_10 AC 86 ms
24,952 KB
testcase_11 AC 85 ms
22,988 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let (|ZERO|ODD|EVE|) n = 
    match n%2,n with
    | _,0 -> ZERO
    | 0,x -> EVE x
    | _,x -> ODD x

let genTakableEdgeLengthList = function
    | ZERO  -> [0]
    | ODD x -> [1 .. (x/2)+1]
    | EVE x -> [1 .. (x/2)  ] 

let D = stdin.ReadLine() |> int

D/2
|> genTakableEdgeLengthList
|> List.map (fun x -> x * (D/2-x))
|> List.max
|> printfn "%i"     
0