結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
Ueki
|
| 提出日時 | 2019-03-22 23:04:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 333 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 82,596 KB |
| 実行使用メモリ | 65,388 KB |
| 最終ジャッジ日時 | 2024-11-18 13:28:48 |
| 合計ジャッジ時間 | 2,320 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N = int(input())
S = input()[:-1]
U = []
ans = 0
for i, c in enumerate(S):
if c == "U":
U.append(i)
elif c == "M":
for u in U:
if 2*i-u < N and S[i+i-u] == "G":
ans += 1
print(ans)
Ueki