結果

問題 No.354 メルセンヌ素数
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-10 12:07:41
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 412 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-04-28 06:40:50
合計ジャッジ時間 1,312 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,784 KB
testcase_01 AC 14 ms
6,912 KB
testcase_02 AC 13 ms
6,912 KB
testcase_03 AC 13 ms
6,784 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys 
import os
import collections
import math

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

def may_mel(p):
  print len(format(int(math.pow(2, p))-1, "b"))

may_mel(int(raw_input()))
0