結果

問題 No.178 美しいWhitespace (1)
ユーザー regeregeregerege
提出日時 2016-11-16 23:37:47
言語 F#
(F# 4.0)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 5,839 ms
コンパイル使用メモリ 186,360 KB
実行使用メモリ 35,344 KB
最終ジャッジ日時 2024-05-04 14:36:20
合計ジャッジ時間 14,842 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
34,892 KB
testcase_01 AC 298 ms
34,512 KB
testcase_02 AC 304 ms
34,648 KB
testcase_03 AC 301 ms
34,768 KB
testcase_04 AC 301 ms
35,208 KB
testcase_05 AC 313 ms
35,076 KB
testcase_06 AC 301 ms
35,068 KB
testcase_07 AC 309 ms
34,956 KB
testcase_08 AC 306 ms
35,340 KB
testcase_09 AC 333 ms
35,336 KB
testcase_10 AC 302 ms
35,068 KB
testcase_11 AC 307 ms
35,344 KB
testcase_12 AC 309 ms
35,088 KB
testcase_13 AC 303 ms
35,328 KB
testcase_14 AC 304 ms
34,948 KB
testcase_15 AC 303 ms
34,820 KB
testcase_16 AC 301 ms
34,952 KB
testcase_17 AC 301 ms
35,344 KB
testcase_18 AC 306 ms
35,224 KB
testcase_19 AC 305 ms
34,956 KB
testcase_20 AC 300 ms
34,948 KB
testcase_21 AC 304 ms
35,204 KB
testcase_22 AC 305 ms
34,892 KB
testcase_23 AC 303 ms
35,204 KB
testcase_24 AC 313 ms
34,960 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (202 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 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))
0