結果

問題 No.414 衝動
ユーザー mesame3993mesame3993
提出日時 2021-11-16 15:10:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 75,936 KB
最終ジャッジ日時 2023-08-22 15:03:49
合計ジャッジ時間 3,182 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
75,768 KB
testcase_01 AC 71 ms
71,868 KB
testcase_02 AC 69 ms
71,784 KB
testcase_03 WA -
testcase_04 AC 89 ms
75,648 KB
testcase_05 AC 89 ms
75,640 KB
testcase_06 AC 88 ms
75,936 KB
testcase_07 AC 72 ms
71,544 KB
testcase_08 AC 83 ms
75,852 KB
testcase_09 WA -
testcase_10 AC 73 ms
71,560 KB
testcase_11 AC 73 ms
75,600 KB
testcase_12 AC 75 ms
75,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  input=stdin.readline
  m = int(input())
  def factorization(n):
    # soinsuubunkai, cnt, kosuu
    arr, tmp = [], n
    for i in range(2, int(-(-n**0.5//1))+1):
      if tmp % i == 0:
        cnt = 0
        while tmp % i == 0:
          cnt += 1
          tmp //= i
        arr.append([i, cnt])
    if tmp != 1:
      arr.append([tmp, 1])
    if len(arr) == 0:
      arr.append([n, 1])
    return arr
  f = factorization(m)
  if len(f) == 1:
    print(*f[0])
  else:
    print(f[0][0], m//f[0][0])
main()
0