結果
| 問題 |
No.3204 Permuted Integer
|
| コンテスト | |
| ユーザー |
dp_ijk
|
| 提出日時 | 2025-07-18 21:25:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 478 ms / 2,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 82,276 KB |
| 実行使用メモリ | 95,460 KB |
| 最終ジャッジ日時 | 2025-07-18 23:35:10 |
| 合計ジャッジ時間 | 12,116 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 26 |
ソースコード
d = {}
for x in range(1, int(2e5)):
Q = x*x
digits = [int(c) for c in str(Q)]
digits.sort()
for c0 in range(10):
if 10 < c0 + len(digits): break
d.setdefault((0,) * c0 + tuple(digits), Q)
T = int(input())
ans = []
for _ in range(T):
N = int(input())
digits = [int(c) for c in str(N)]
digits.sort()
res = d.get(tuple(digits), -1)
ans.append(res)
for a in ans:
print(a)
dp_ijk