結果

問題 No.3388 Sum of Function
コンテスト
ユーザー yt142857
提出日時 2025-11-20 15:30:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 58,448 KB
最終ジャッジ日時 2025-11-28 20:54:46
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def f(x):
  return x**3-x**2+x+1
def Is_Prime(x):
  if x == 1:
    return False
  for i in range(2,x):
    if x%i==0:
      return False
  return True
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  if Is_Prime(i):
    ans += f(i)
print(ans)
0