結果
問題 |
No.805 UMG
|
ユーザー |
|
提出日時 | 2019-04-07 22:47:22 |
言語 | Kotlin (2.1.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 13,237 ms |
コンパイル使用メモリ | 435,300 KB |
実行使用メモリ | 57,180 KB |
最終ジャッジ日時 | 2024-11-18 13:42:36 |
合計ジャッジ時間 | 23,427 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 RE * 2 |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^
ソースコード
fun main(args: Array<String>) { val n = readLine()!!.toInt() val s = readLine()!! var c = 0 for (i in s.indexOf('U')..(n - 3)) { if (!s[i].equals('U')) continue for (d in 1..((n - 1 - i) / 2)) { val j = i + d val k = j + d if (s[j].equals('M') && s[k].equals('G')) c++ } } println(c) }