結果

問題 No.3388 Sum of Function
コンテスト
ユーザー kidodesu
提出日時 2025-11-28 21:45:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 82,660 KB
実行使用メモリ 59,068 KB
最終ジャッジ日時 2025-11-28 21:45:24
合計ジャッジ時間 2,568 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

a, b = map(int, input().split())
ans = 0
def p(t):
    if t == 1:
        return 0
    for i in range(2, t):
        if t % i == 0:
            return 0
    return 1

def f(t):
    return t*t*t-t*t+t+1

for i in range(a, b+1):
    if p(i):
        ans += f(i)
print(ans)
0