結果

問題 No.3204 Permuted Integer
ユーザー 回転
提出日時 2025-07-18 22:08:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,050 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 193,888 KB
最終ジャッジ日時 2025-07-18 23:39:54
合計ジャッジ時間 22,477 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

ans = defaultdict(lambda:-1)
for i in range(4*10**4,0,-1):
    a = sorted(str(i*i))
    for zero in range(10):
        ans[tuple(["0"]*zero + a)] = i*i

T = int(input())
for _ in range(T):
    N = input()
    print(ans[tuple(sorted(N))])
0