結果

問題 No.3388 Sum of Function
コンテスト
ユーザー yu23578
提出日時 2025-10-19 01:30:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 1,873 ms
コンパイル使用メモリ 193,720 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-11-28 20:50:07
合計ジャッジ時間 3,072 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define int long long

int A,B;

signed main(){
  cin>>A>>B;
  int ans = 0;
  for(int i = A; i <= B; i++){
  	int cnt = 0;
  	for(int j = 1; j <= i; j++){
  		if(i % j == 0) cnt++;
  	}
  	if(cnt == 2){
  		ans += (i*i*i) - (i*i) + (i) + 1;
  	}
  }
  cout << ans << "\n";
}
0