結果

問題 No.216 FAC
ユーザー kuuso1kuuso1
提出日時 2016-08-18 18:15:43
言語 F#
(F# 4.0)
結果
AC  
実行時間 98 ms / 1,000 ms
コード長 738 bytes
コンパイル時間 3,451 ms
コンパイル使用メモリ 169,340 KB
実行使用メモリ 25,500 KB
最終ジャッジ日時 2023-08-07 15:15:24
合計ジャッジ時間 7,200 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
23,252 KB
testcase_01 AC 96 ms
23,224 KB
testcase_02 AC 95 ms
23,372 KB
testcase_03 AC 94 ms
23,360 KB
testcase_04 AC 94 ms
23,288 KB
testcase_05 AC 95 ms
23,336 KB
testcase_06 AC 94 ms
25,360 KB
testcase_07 AC 93 ms
23,308 KB
testcase_08 AC 94 ms
23,448 KB
testcase_09 AC 95 ms
23,456 KB
testcase_10 AC 95 ms
23,296 KB
testcase_11 AC 95 ms
23,448 KB
testcase_12 AC 96 ms
25,436 KB
testcase_13 AC 96 ms
25,500 KB
testcase_14 AC 95 ms
23,396 KB
testcase_15 AC 95 ms
25,392 KB
testcase_16 AC 96 ms
25,228 KB
testcase_17 AC 95 ms
23,248 KB
testcase_18 AC 96 ms
23,304 KB
testcase_19 AC 95 ms
25,260 KB
testcase_20 AC 96 ms
25,292 KB
testcase_21 AC 98 ms
23,240 KB
testcase_22 AC 96 ms
25,312 KB
testcase_23 AC 96 ms
23,340 KB
testcase_24 AC 95 ms
23,388 KB
testcase_25 AC 96 ms
23,448 KB
testcase_26 AC 95 ms
21,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        let N = stdin.ReadLine() |> int
        let A = stdin.ReadLine().Split() |> Array.map int
        let B = stdin.ReadLine().Split() |> Array.map int
        
        let AB = Array.zip B A |> Seq.groupBy fst |>Seq.map (fun (x,ss) -> (x,Seq.sumBy snd ss) )
        let res = Seq.tryFind (fun p -> (fst p) = 0 ) AB 
        let ksScore = if Option.isNone res then 0 else (Option.get res |> snd)
        let elseMem = Seq.filter (fun p -> (fst p) <> 0 ) AB 
        let elseScore = if (Seq.length elseMem = 0) then 0 else (elseMem |> Seq.map snd |> Seq.max)
        (if ksScore < elseScore then "NO" else "YES") |> printfn "%s"
        
        
let mySol = new Sol()
mySol.Solve()
0