結果

問題 No.341 沈黙の期間
ユーザー kuuso1kuuso1
提出日時 2016-08-17 03:05:43
言語 F#
(F# 4.0)
結果
AC  
実行時間 319 ms / 5,000 ms
コード長 545 bytes
コンパイル時間 6,778 ms
コンパイル使用メモリ 188,500 KB
実行使用メモリ 34,528 KB
最終ジャッジ日時 2024-04-25 08:13:41
合計ジャッジ時間 12,584 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 304 ms
34,396 KB
testcase_01 AC 307 ms
33,728 KB
testcase_02 AC 302 ms
34,528 KB
testcase_03 AC 307 ms
33,852 KB
testcase_04 AC 306 ms
34,524 KB
testcase_05 AC 314 ms
34,140 KB
testcase_06 AC 313 ms
34,384 KB
testcase_07 AC 308 ms
34,268 KB
testcase_08 AC 309 ms
34,396 KB
testcase_09 AC 316 ms
34,376 KB
testcase_10 AC 307 ms
34,528 KB
testcase_11 AC 301 ms
34,140 KB
testcase_12 AC 317 ms
33,508 KB
testcase_13 AC 319 ms
34,528 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (231 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 s = stdin.ReadLine()
        let mutable max = 0
        let mutable cnt = 0
        let N = Seq.length s
        // '…' == '\u2026'
        for i = 0 to (N-1) do
            match i with
            | 0 -> ( if s.[0] = '\u2026' then (cnt <- 1 ; max <- 1) else ( cnt <- 0 ) )
            | _ -> ( if s.[i] = '\u2026' then (cnt <- (cnt+1) ; max <- if cnt > max then cnt else max ) else ( cnt <- 0 ) )
        
        printfn "%d" max
        
let mySol = new Sol()
mySol.Solve()
0