結果

問題 No.1657 Sum is Prime (Easy Version)
ユーザー jamesjames
提出日時 2021-08-27 22:59:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 24,528 KB
最終ジャッジ日時 2024-11-21 04:27:26
合計ジャッジ時間 55,433 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 TLE * 1
other AC * 2 WA * 2 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

L,R = map(int, input().split())
count = 0

def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True

for i in range(L-1,R):
    s = i+1
    for j in range(i,R):
        for k in range(i+1,j+1):
            s += (k+1)
        if is_prime(s) == True:
            count += 1

print(count)
0