結果

問題 No.805 UMG
ユーザー iwot
提出日時 2020-06-13 00:38:53
言語 F#
(F# 4.0)
結果
AC  
実行時間 368 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 12,017 ms
コンパイル使用メモリ 185,224 KB
実行使用メモリ 35,132 KB
最終ジャッジ日時 2024-11-18 14:04:19
合計ジャッジ時間 22,945 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (257 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 #

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

let mutable result = 0

for i in 0 .. n-3 do
    if s.[i] = 'U' then
        for j in i .. n-2 do
            if s.[j] = 'M' && j+j-i < s.Length && s.[j+j-i] = 'G' then
                result <- result + 1

printfn "%d" result
0