結果

問題 No.300 平方数
ユーザー kichirb3kichirb3
提出日時 2018-03-24 23:37:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 8,904 KB
最終ジャッジ日時 2023-09-07 09:00:13
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,776 KB
testcase_01 AC 21 ms
8,792 KB
testcase_02 AC 56 ms
8,700 KB
testcase_03 AC 19 ms
8,484 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 19 ms
8,660 KB
testcase_08 AC 18 ms
8,816 KB
testcase_09 AC 19 ms
8,780 KB
testcase_10 AC 19 ms
8,704 KB
testcase_11 AC 19 ms
8,712 KB
testcase_12 AC 20 ms
8,812 KB
testcase_13 WA -
testcase_14 AC 24 ms
8,716 KB
testcase_15 AC 47 ms
8,724 KB
testcase_16 AC 43 ms
8,760 KB
testcase_17 AC 72 ms
8,660 KB
testcase_18 AC 23 ms
8,816 KB
testcase_19 AC 39 ms
8,832 KB
testcase_20 WA -
testcase_21 AC 73 ms
8,844 KB
testcase_22 AC 66 ms
8,724 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 55 ms
8,732 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 51 ms
8,776 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.300 平方数
https://yukicoder.me/problems/no/300

"""
import sys
from sys import stdin
from collections import Counter
input = stdin.readline


def calc_divisors(N):
    divisors = []
    for i in range(2, int(N**0.5)+1):
        while N % i == 0:
            divisors.append(i)
            N //= i
    return divisors


def solve(X):
    divisors = calc_divisors(X)
    ans = 1
    for v, fre in Counter(divisors).most_common():
        if fre % 2 == 1:
            ans *= v
    return ans


def main(args):
    X = int(input())
    ans = solve(X)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
0