結果
| 問題 | No.805 UMG |
| コンテスト | |
| ユーザー |
hiragn
|
| 提出日時 | 2022-11-12 21:52:52 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 15,992 KB |
| 最終ジャッジ日時 | 2026-08-27 01:44:58 |
| 合計ジャッジ時間 | 8,979 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 15 TLE * 1 -- * 4 |
ソースコード
import collections
import itertools
def main():
_ = input()
s = input()
d = collections.defaultdict(list)
for i, c in enumerate(s):
d[c].append(i)
ans = 0
for i, j in itertools.product(d['U'], d['M']):
if 2 * j - i in d['G']:
ans += 1
print(ans)
if __name__ == "__main__":
main()
hiragn