結果

問題 No.300 平方数
コンテスト
ユーザー akitsugu777
提出日時 2018-11-30 11:05:57
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 373 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 615 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 30,584 KB
最終ジャッジ日時 2026-03-13 21:49:13
合計ジャッジ時間 51,130 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

x = int(input())

d = {}
s = 0
while s == 0:
    for i in range(2, x+1):
        if x % i == 0:
            x = x// i
            if not i in d:
                d[i] = 1
            else:
                d[i] += 1
            if x == 1:
                s = 1
            break

keys = [k for k, v in d.items() if v % 2 != 0]

ans = 1
for i in keys:
    ans *= i

print(ans)
0