結果
問題 |
No.2201 p@$$w0rd
|
ユーザー |
![]() |
提出日時 | 2025-04-11 17:20:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 594 bytes |
コンパイル時間 | 387 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-04-11 17:20:28 |
合計ジャッジ時間 | 2,405 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 6 |
ソースコード
from collections import defaultdict N, S = "N", "S" def f2(x): return 2 ** (x - 1) - 1 def f1(x): return 2**x - 1 def f_main(s): d = defaultdict(int) for c in s: if c in {"a", "s"}: d[S] += 1 if c in {"l", "o"}: d[N] += 1 if len(d) < 2: return 0 elif sum(d.values()) == len(s): res = 0 for a, b in [(S, N), (N, S)]: res += f2(d[a]) * f1(d[b]) return res else: res = 1 for v in d.values(): res *= f1(v) return res print(f_main(input()))