結果

問題 No.80 四角形を描こう
ユーザー taktak
提出日時 2018-06-14 12:22:01
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 315 bytes
コンパイル時間 6,157 ms
コンパイル使用メモリ 160,128 KB
実行使用メモリ 25,008 KB
最終ジャッジ日時 2023-09-13 04:07:13
合計ジャッジ時間 6,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
23,040 KB
testcase_01 AC 81 ms
22,940 KB
testcase_02 AC 80 ms
22,944 KB
testcase_03 AC 79 ms
23,052 KB
testcase_04 AC 79 ms
22,824 KB
testcase_05 AC 80 ms
25,008 KB
testcase_06 RE -
testcase_07 AC 82 ms
24,880 KB
testcase_08 AC 80 ms
22,932 KB
testcase_09 AC 82 ms
22,944 KB
testcase_10 AC 81 ms
22,952 KB
testcase_11 AC 79 ms
21,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

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

let genTakableEdgeLengthList = function
    | 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