結果

問題 No.312 置換処理
コンテスト
ユーザー pluto77
提出日時 2016-02-16 18:32:46
言語 PyPy2
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 412 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 135 ms
コンパイル使用メモリ 76,836 KB
最終ジャッジ日時 2025-12-03 19:24:29
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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