結果
| 問題 |
No.2593 Reorder and Mod 120
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-23 17:33:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 641 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 82,152 KB |
| 実行使用メモリ | 75,392 KB |
| 最終ジャッジ日時 | 2024-09-27 12:28:43 |
| 合計ジャッジ時間 | 2,555 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 21 WA * 5 |
ソースコード
N = int(input())
S = input()
dat = [0] * 10
for s in S:
dat[int(s)] += 1
ans = set()
t = 0
for i in range(1,10):
if dat[i]:
dat[i] -= 1
else:
continue
for j in range(1,10):
if dat[j]:
dat[j] -= 1
else:
continue
for k in range(1,10):
if dat[k]:
dat[k] -= 1
else:
continue
t = i + 10 * j + 100 * k
for u in range(1,10):
t += u * dat[u] * 40
ans.add(t % 120)
dat[k] += 1
dat[j] += 1
dat[i] += 1
print(len(ans))