結果

問題 No.414 衝動
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-10 00:11:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 319 ms / 1,000 ms
コード長 411 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2024-04-27 08:25:45
合計ジャッジ時間 5,105 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
16,512 KB
testcase_01 AC 301 ms
16,640 KB
testcase_02 AC 293 ms
16,640 KB
testcase_03 AC 308 ms
16,640 KB
testcase_04 AC 302 ms
16,640 KB
testcase_05 AC 312 ms
16,384 KB
testcase_06 AC 313 ms
16,512 KB
testcase_07 AC 309 ms
16,384 KB
testcase_08 AC 310 ms
16,640 KB
testcase_09 AC 319 ms
16,640 KB
testcase_10 AC 306 ms
16,384 KB
testcase_11 AC 311 ms
16,640 KB
testcase_12 AC 303 ms
16,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_table(n):
  list = [True for _ in xrange(n + 1)]
  i = 2
  while i * i <= n:
    if list[i]:
      j = i + i
      while j <= n:
        list[j] = False
        j += i
    i += 1

  table = [i for i in xrange(n + 1) if list[i] and i >= 2]
  return table
import sys
b = prime_table(10**6)

M = int(raw_input())
for prime in b:
  if M%prime == 0:
     print prime, M/prime
     sys.exit(0)

print "1", M
0