結果
| 問題 |
No.1994 Confusing Name
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 21:29:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 571 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 881,528 KB |
| 最終ジャッジ日時 | 2024-11-26 03:56:20 |
| 合計ジャッジ時間 | 47,537 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 TLE * 14 MLE * 6 |
ソースコード
n = int(input())
cnt = {}
def f(S):
lst = [ord(s) - 96 for s in S]
tot = 0
for l in lst:
tot *= 26
tot += l
times = 1
for l in lst[::-1]:
tot -= times * l
for j in range(1, 27):
if j == l:
pass
else:
tot += times * j
cnt[tot] = cnt.get(tot, 0) + 1
tot -= times * j
tot += times * l
times *= 26
return tot
lst = []
for _ in range(n):
S = input()
lst.append(f(S))
for s in lst:
print(cnt.get(s, 0))