結果
問題 | No.178 美しいWhitespace (1) |
ユーザー | regerege |
提出日時 | 2016-11-16 23:37:47 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 4,890 ms |
コンパイル使用メモリ | 154,412 KB |
実行使用メモリ | 25,120 KB |
最終ジャッジ日時 | 2023-08-17 07:45:10 |
合計ジャッジ時間 | 6,858 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 91 ms
23,036 KB |
testcase_01 | AC | 91 ms
23,048 KB |
testcase_02 | AC | 89 ms
20,920 KB |
testcase_03 | AC | 89 ms
22,940 KB |
testcase_04 | AC | 92 ms
21,032 KB |
testcase_05 | AC | 92 ms
23,024 KB |
testcase_06 | AC | 93 ms
22,952 KB |
testcase_07 | AC | 93 ms
23,012 KB |
testcase_08 | AC | 95 ms
25,120 KB |
testcase_09 | AC | 96 ms
25,088 KB |
testcase_10 | AC | 93 ms
24,940 KB |
testcase_11 | AC | 93 ms
23,028 KB |
testcase_12 | AC | 94 ms
23,112 KB |
testcase_13 | AC | 93 ms
22,984 KB |
testcase_14 | AC | 94 ms
24,996 KB |
testcase_15 | AC | 94 ms
23,068 KB |
testcase_16 | AC | 93 ms
25,120 KB |
testcase_17 | AC | 92 ms
23,064 KB |
testcase_18 | AC | 92 ms
23,068 KB |
testcase_19 | AC | 94 ms
25,024 KB |
testcase_20 | AC | 94 ms
23,048 KB |
testcase_21 | AC | 94 ms
25,032 KB |
testcase_22 | AC | 92 ms
23,040 KB |
testcase_23 | AC | 91 ms
23,084 KB |
testcase_24 | AC | 91 ms
23,124 KB |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
let N = stdin.ReadLine() |> int let r() = let arr = stdin.ReadLine().Split(' ') |> Array.map int64 in arr.[0] + arr.[1] * 4L let l = [ for x in 1..N -> r() ] let m = List.max l let s,b = List.fold (fun (s,b) n -> let x = m - n in (s+x, b||x%2L=1L)) (0L,false) l printfn "%d" (if b then -1L else (s/2L))