結果
| 問題 | No.3388 Sum of Function |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-29 07:08:38 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 424 bytes |
| 記録 | |
| コンパイル時間 | 2,943 ms |
| コンパイル使用メモリ | 275,996 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-29 07:08:43 |
| 合計ジャッジ時間 | 4,345 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
int s[] = {2, 3, 5, 7};
long long ans = 0LL;
cin >> a >> b;
if (a < 2) a = 2;
for(int i=a; i<=b; i++){
bool f = true;
for(int j=0; j<4; j++){
if (i / s[j] > 1 && i % s[j] == 0) f = false;
}
if (f) ans += (long long) pow (i, 3) - pow (i, 2) + i + 1;
}
cout << ans << endl;
}