結果
問題 | No.1994 Confusing Name |
ユーザー |
👑 |
提出日時 | 2022-07-01 21:39:58 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 439 ms / 2,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 88,788 KB |
最終ジャッジ日時 | 2024-11-26 04:23:59 |
合計ジャッジ時間 | 8,447 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n = int(input())T = []se = set()for _ in range(n):S = input()lst = [ord(s) - 96 for s in S]tot = 0for l in lst:tot *= 26tot += lse.add(tot)T.append(lst)for lst in T:ans = 0times = 1tot = 0for l in lst:tot *= 26tot += lse.add(tot)for l in lst[::-1]:tot -= times * lfor j in range(1, 27):if j == l:passelse:tot += times * jif tot in se:ans += 1tot -= times * jtot += times * ltimes *= 26print(ans)