結果

問題 No.713 素数の和
ユーザー TAMUKINTV
提出日時 2018-08-07 15:22:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 18:25:43
合計ジャッジ時間 862 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(n):
    n=abs(n)
    if n==2: return True
    if n<2 or n&1==0: return False
    return pow(2,n-1,n)==1

def main():
    N=int(input())
    sum=0
    for i in range(1,N+1):
        if is_prime(i)==True:
            sum+=i
    print(sum)

if __name__=="__main__":
    main()
0