結果

問題 No.3388 Sum of Function
コンテスト
ユーザー Aotori
提出日時 2025-12-25 16:23:56
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
結果
WA  
実行時間 -
コード長 474 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,870 ms
コンパイル使用メモリ 194,844 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-25 16:23:59
合計ジャッジ時間 3,160 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

int f(int x){
    return (x * x * x) - (x * x) + (x) + (1);
}

int main()
{
    int A, B;
    cin >> A >> B;
    int sum = 0;
    for(int i = A; i < B+1; i++){
        bool N = true;
        for(int j = 2; j < i; j++){
            if(i % j == 0){
                N = false;
            }
        }
        if(N){
            sum += f(i);
        }
    }
    cout << sum << endl;
}
0