結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
hiragn
|
| 提出日時 | 2022-11-12 21:52:52 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 354 bytes |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,820 KB |
| 最終ジャッジ日時 | 2024-09-14 10:24:42 |
| 合計ジャッジ時間 | 7,260 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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