結果

問題 No.300 平方数
ユーザー nanaenanae
提出日時 2017-06-06 13:33:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 150 ms / 1,000 ms
コード長 322 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 11,800 KB
実行使用メモリ 10,144 KB
最終ジャッジ日時 2023-10-23 17:50:59
合計ジャッジ時間 6,441 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,144 KB
testcase_01 AC 31 ms
10,144 KB
testcase_02 AC 90 ms
10,144 KB
testcase_03 AC 31 ms
10,144 KB
testcase_04 AC 30 ms
10,144 KB
testcase_05 AC 31 ms
10,144 KB
testcase_06 AC 31 ms
10,144 KB
testcase_07 AC 32 ms
10,144 KB
testcase_08 AC 31 ms
10,144 KB
testcase_09 AC 31 ms
10,144 KB
testcase_10 AC 31 ms
10,144 KB
testcase_11 AC 31 ms
10,144 KB
testcase_12 AC 31 ms
10,144 KB
testcase_13 AC 150 ms
10,144 KB
testcase_14 AC 38 ms
10,144 KB
testcase_15 AC 74 ms
10,144 KB
testcase_16 AC 69 ms
10,144 KB
testcase_17 AC 116 ms
10,144 KB
testcase_18 AC 39 ms
10,144 KB
testcase_19 AC 63 ms
10,144 KB
testcase_20 AC 53 ms
10,144 KB
testcase_21 AC 119 ms
10,144 KB
testcase_22 AC 109 ms
10,144 KB
testcase_23 AC 130 ms
10,144 KB
testcase_24 AC 97 ms
10,144 KB
testcase_25 AC 127 ms
10,144 KB
testcase_26 AC 119 ms
10,144 KB
testcase_27 AC 92 ms
10,144 KB
testcase_28 AC 126 ms
10,144 KB
testcase_29 AC 141 ms
10,144 KB
testcase_30 AC 141 ms
10,144 KB
testcase_31 AC 146 ms
10,144 KB
testcase_32 AC 100 ms
10,144 KB
testcase_33 AC 70 ms
10,144 KB
testcase_34 AC 135 ms
10,144 KB
testcase_35 AC 101 ms
10,144 KB
testcase_36 AC 114 ms
10,144 KB
testcase_37 AC 99 ms
10,144 KB
testcase_38 AC 91 ms
10,144 KB
testcase_39 AC 106 ms
10,144 KB
testcase_40 AC 96 ms
10,144 KB
testcase_41 AC 68 ms
10,144 KB
testcase_42 AC 80 ms
10,144 KB
testcase_43 AC 121 ms
10,144 KB
testcase_44 AC 100 ms
10,144 KB
testcase_45 AC 65 ms
10,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import sqrt

def solve():
    x = int(input())

    y = 1

    for p in range(2, int(sqrt(x)) + 1):
        q = 0

        while x % p == 0:
            q += 1
            x //= p

        if q & 1:
            y *= p

    if x > 1:
        y *= x

    print(y)

if __name__ == '__main__':
    solve()
0