結果

問題 No.197 手品
ユーザー guriceringuricerin
提出日時 2020-01-30 15:36:07
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 1,337 bytes
コンパイル時間 4,449 ms
コンパイル使用メモリ 166,308 KB
実行使用メモリ 24,480 KB
最終ジャッジ日時 2023-10-14 08:28:35
合計ジャッジ時間 8,486 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,456 KB
testcase_01 AC 61 ms
20,300 KB
testcase_02 AC 63 ms
22,484 KB
testcase_03 AC 62 ms
22,312 KB
testcase_04 AC 63 ms
22,344 KB
testcase_05 AC 64 ms
22,428 KB
testcase_06 AC 62 ms
24,308 KB
testcase_07 AC 64 ms
24,452 KB
testcase_08 AC 62 ms
22,388 KB
testcase_09 AC 64 ms
22,320 KB
testcase_10 AC 64 ms
22,260 KB
testcase_11 AC 66 ms
24,448 KB
testcase_12 AC 64 ms
22,344 KB
testcase_13 AC 62 ms
22,252 KB
testcase_14 AC 62 ms
24,368 KB
testcase_15 AC 63 ms
22,320 KB
testcase_16 AC 62 ms
22,388 KB
testcase_17 AC 62 ms
24,428 KB
testcase_18 AC 62 ms
20,300 KB
testcase_19 AC 64 ms
22,300 KB
testcase_20 AC 62 ms
22,268 KB
testcase_21 AC 64 ms
22,340 KB
testcase_22 AC 64 ms
22,260 KB
testcase_23 AC 64 ms
24,368 KB
testcase_24 AC 63 ms
22,416 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 64 ms
22,404 KB
testcase_28 AC 62 ms
22,340 KB
testcase_29 AC 64 ms
22,424 KB
testcase_30 WA -
testcase_31 AC 61 ms
24,304 KB
testcase_32 AC 62 ms
22,316 KB
testcase_33 AC 61 ms
22,384 KB
testcase_34 WA -
testcase_35 AC 61 ms
22,300 KB
testcase_36 AC 61 ms
22,380 KB
testcase_37 AC 63 ms
24,480 KB
testcase_38 WA -
testcase_39 AC 62 ms
22,396 KB
testcase_40 AC 65 ms
22,416 KB
testcase_41 AC 63 ms
22,428 KB
testcase_42 AC 61 ms
22,376 KB
testcase_43 AC 62 ms
22,320 KB
testcase_44 AC 64 ms
22,300 KB
testcase_45 AC 62 ms
22,496 KB
testcase_46 AC 63 ms
22,388 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f
    let readChars() = read string |> Seq.toArray
    let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<AutoOpen>]
module Cout =
    let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
    let print (s: string) = writer.Write s
    let println (s: string) = writer.WriteLine s
    let inline puts (s: ^a) = string s |> println

let main() =
    let b = read string
    let n = read int64
    let a = read string
    let yes = "SUCCESS"
    let no = "FAILURE"

    let bo =
        b
        |> Seq.filter (fun c -> c = 'o')
        |> Seq.length

    let ao =
        a
        |> Seq.filter (fun c -> c = 'o')
        |> Seq.length

    if b = "ooo" then
        if a = "ooo" then no else yes
    elif b = "xxx" then
        if a = "xxx" then no else yes
    else
        match n with
        | 0L ->
            if b = a then no else yes
        | 1L ->
            match bo = ao with
            | true ->
                if b.[..1] = a.[1..] then yes else no
            | _ -> yes
        | _ ->
            if bo = ao then no else yes
    |> puts


    ()

main()
writer.Close()
writer.Close()
0