結果
問題 | No.178 美しいWhitespace (1) |
ユーザー |
|
提出日時 | 2016-11-16 23:37:47 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 344 ms / 2,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 13,898 ms |
コンパイル使用メモリ | 184,660 KB |
実行使用メモリ | 35,464 KB |
最終ジャッジ日時 | 2024-11-26 02:40:46 |
合計ジャッジ時間 | 16,709 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (858 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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))