結果

問題 No.136 Yet Another GCD Problem
ユーザー Snark86Snark86
提出日時 2016-04-27 07:00:09
言語 Python2
(2.7.18)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 10,416 KB
最終ジャッジ日時 2024-10-04 16:00:18
合計ジャッジ時間 2,624 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n,k = map(int,raw_input().split())

a = [i for i in range(2,n+1)]
p = []
while a:
	if a[0] <= math.sqrt(a[-1]):
		p.append(a[0])
		a = filter(lambda x:x%a[0]!=0, a)
	else:
		p += a
		break
b=[2,1]
if n not in p:
	for i in p:
		if n%i == 0:
			s = n/i
			b = [i,s]
			break
print b[1]
0