結果

問題 No.239 にゃんぱすー
ユーザー kuuso1kuuso1
提出日時 2016-08-18 06:20:39
言語 F#
(F# 4.0)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 6,901 ms
コンパイル使用メモリ 190,108 KB
実行使用メモリ 35,560 KB
最終ジャッジ日時 2024-04-25 08:42:20
合計ジャッジ時間 18,982 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
34,036 KB
testcase_01 AC 301 ms
34,032 KB
testcase_02 AC 299 ms
34,192 KB
testcase_03 AC 310 ms
33,900 KB
testcase_04 AC 310 ms
34,032 KB
testcase_05 AC 310 ms
34,028 KB
testcase_06 AC 304 ms
33,772 KB
testcase_07 AC 309 ms
33,944 KB
testcase_08 AC 306 ms
34,028 KB
testcase_09 AC 300 ms
34,052 KB
testcase_10 AC 303 ms
34,644 KB
testcase_11 AC 305 ms
34,536 KB
testcase_12 AC 310 ms
34,296 KB
testcase_13 AC 313 ms
34,748 KB
testcase_14 AC 307 ms
35,040 KB
testcase_15 AC 313 ms
34,704 KB
testcase_16 AC 310 ms
34,472 KB
testcase_17 AC 310 ms
34,916 KB
testcase_18 AC 305 ms
34,412 KB
testcase_19 AC 302 ms
35,288 KB
testcase_20 AC 313 ms
34,820 KB
testcase_21 AC 315 ms
35,436 KB
testcase_22 AC 313 ms
35,380 KB
testcase_23 AC 313 ms
35,560 KB
testcase_24 AC 320 ms
35,528 KB
testcase_25 AC 306 ms
35,364 KB
testcase_26 AC 319 ms
35,312 KB
testcase_27 AC 317 ms
33,904 KB
testcase_28 AC 309 ms
34,644 KB
testcase_29 AC 305 ms
34,728 KB
testcase_30 AC 303 ms
34,644 KB
testcase_31 AC 302 ms
35,004 KB
testcase_32 AC 305 ms
35,112 KB
testcase_33 AC 300 ms
34,812 KB
testcase_34 AC 302 ms
34,564 KB
testcase_35 AC 298 ms
35,528 KB
testcase_36 AC 309 ms
35,464 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (241 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 #

open System
type Sol() =
    member this.Solve() = 
        let N = stdin.ReadLine() |> int
        let S = Array.zeroCreate<string array> N
        for i = 0 to (N-1) do
            S.[i] <- stdin.ReadLine().Split();
        
        let checkRenchon (s :string [] []) j = 
            let mutable chk = true
            for i=0 to (N-1) do 
                if i <> j then (chk <- (chk && (s.[i].[j] = "nyanpass" )))
            chk
        
        let mutable cnt = 0
        let mutable idx = -1
        for i = 0 to (N-1) do 
            match (checkRenchon S i) with
            | true -> (cnt <- (cnt + 1) ;idx <- (i+1))
            | false -> ()
        
        printfn "%d" (if cnt = 1 then idx else -1)

let mySol = new Sol()
mySol.Solve()
0