結果
| 問題 | No.805 UMG |
| コンテスト | |
| ユーザー |
hiragn
|
| 提出日時 | 2022-11-12 21:52:52 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 21,760 KB |
| 最終ジャッジ日時 | 2026-04-04 12:05:35 |
| 合計ジャッジ時間 | 8,096 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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