Submission #953983


Source Code Expand

let solve n (s:string) (t:string) =
    if s.Length + t.Length <= n then n
    elif s = t && n <= s.Length then s.Length
    else
        let sameLen = seq s |> Seq.rev |> Seq.zip (seq t) |> Seq.takeWhile (fun (s, t) -> s = t) |> Seq.length
        s.Length + t.Length - sameLen



let () =
  let n = stdin.ReadLine () |> int
  let s = stdin.ReadLine ()
  let t = stdin.ReadLine ()

  solve n s t |> printfn "%d"

Submission Info

Submission Time
Task A - Prefix and Suffix
User suzukim0702
Language F# (Mono 4.0)
Score 0
Code Size 426 Byte
Status WA
Exec Time 47 ms
Memory 4052 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 6
WA × 3
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt
Case Name Status Exec Time Memory
0_00.txt AC 46 ms 3924 KB
0_01.txt AC 46 ms 3924 KB
0_02.txt AC 39 ms 3668 KB
1_00.txt AC 39 ms 3668 KB
1_01.txt AC 39 ms 3668 KB
1_02.txt AC 47 ms 4052 KB
1_03.txt WA 47 ms 4052 KB
1_04.txt WA 47 ms 4052 KB
1_05.txt WA 46 ms 4052 KB