結果

問題 No.805 UMG
ユーザー iwotiwot
提出日時 2020-06-13 00:38:53
言語 F#
(F# 4.0)
結果
AC  
実行時間 360 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 6,934 ms
コンパイル使用メモリ 184,332 KB
実行使用メモリ 34,792 KB
最終ジャッジ日時 2024-04-29 11:09:28
合計ジャッジ時間 17,432 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 319 ms
34,600 KB
testcase_01 AC 322 ms
34,488 KB
testcase_02 AC 323 ms
34,616 KB
testcase_03 AC 323 ms
34,612 KB
testcase_04 AC 321 ms
34,360 KB
testcase_05 AC 329 ms
34,364 KB
testcase_06 AC 337 ms
34,612 KB
testcase_07 AC 330 ms
34,344 KB
testcase_08 AC 323 ms
34,356 KB
testcase_09 AC 321 ms
34,484 KB
testcase_10 AC 329 ms
34,740 KB
testcase_11 AC 331 ms
34,492 KB
testcase_12 AC 327 ms
33,804 KB
testcase_13 AC 326 ms
34,360 KB
testcase_14 AC 325 ms
34,608 KB
testcase_15 AC 320 ms
34,616 KB
testcase_16 AC 326 ms
34,020 KB
testcase_17 AC 331 ms
34,656 KB
testcase_18 AC 327 ms
34,156 KB
testcase_19 AC 329 ms
34,784 KB
testcase_20 AC 326 ms
34,148 KB
testcase_21 AC 329 ms
34,140 KB
testcase_22 AC 332 ms
34,140 KB
testcase_23 AC 353 ms
34,024 KB
testcase_24 AC 341 ms
34,792 KB
testcase_25 AC 360 ms
34,292 KB
testcase_26 AC 341 ms
34,332 KB
testcase_27 AC 355 ms
34,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (213 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