結果

問題 No.312 置換処理
ユーザー pluto77
提出日時 2016-02-16 18:32:46
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 412 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 07:17:56
合計ジャッジ時間 2,176 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
#yuki_312

def prime_decomp(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

n=int(raw_input())
s=prime_decomp(n)

if s[-1]==2:
 print 4
elif s[0]==2 and s[1]==2:
 if s[2]<4:
  print 3
 else:
  print 4
elif s[0]==2:
 i=0
 while s[i]==2:
  i+=1
  continue
 print s[i]
else:
 print s[0]
0