結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
pasoconhoshii
|
| 提出日時 | 2019-03-23 09:00:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 325 bytes |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-18 13:30:52 |
| 合計ジャッジ時間 | 15,175 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 TLE * 5 |
ソースコード
N = int(input())
S = input()
ans = 0
for stride in range(1, N//2+1):
for k in range(0+stride, N-stride+1):
i = k - stride
j = k + stride
if j >= N:
continue
if S[i] == "U" and \
S[k] == "M" and \
S[j] == "G":
ans += 1
print(ans)
pasoconhoshii