結果

問題 No.414 衝動
ユーザー dangodango
提出日時 2023-06-13 16:30:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 1,000 ms
コード長 357 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 75,772 KB
最終ジャッジ日時 2023-09-04 01:46:12
合計ジャッジ時間 3,042 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
75,772 KB
testcase_01 AC 70 ms
71,524 KB
testcase_02 AC 70 ms
71,532 KB
testcase_03 AC 101 ms
75,608 KB
testcase_04 AC 102 ms
75,668 KB
testcase_05 AC 87 ms
75,612 KB
testcase_06 AC 88 ms
75,468 KB
testcase_07 AC 72 ms
71,392 KB
testcase_08 AC 82 ms
75,460 KB
testcase_09 AC 102 ms
75,744 KB
testcase_10 AC 70 ms
71,700 KB
testcase_11 AC 75 ms
75,696 KB
testcase_12 AC 73 ms
75,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor(N):
  divisors = set()
  for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
      divisors.add(i)
      divisors.add(int(N / i))
  return list(sorted(list(divisors)))
def prime(N):
  return len(divisor(N)) == 2
N = int(input())
if N == 1:
  print(1, 1)
else:
  if prime(N):
    print(1, N)
  else:
    K = divisor(N)
    print(K[1], K[-2])
0