結果

問題 No.178 美しいWhitespace (1)
ユーザー regerege
提出日時 2016-11-16 23:34:53
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 11,448 ms
コンパイル使用メモリ 185,900 KB
実行使用メモリ 35,292 KB
最終ジャッジ日時 2024-11-26 02:40:01
合計ジャッジ時間 19,577 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (591 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/

ソースコード

diff #

let N = stdin.ReadLine() |> int
let r() = let arr = stdin.ReadLine().Split(' ') |> Array.map int in arr.[0] + arr.[1] * 4
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%2=1)) (0,false) l
printfn "%d" (if b then -1 else (s/2))
0