結果
問題 |
No.3296 81-like number
|
ユーザー |
![]() |
提出日時 | 2025-08-17 13:28:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 1,711 ms |
コンパイル使用メモリ | 194,740 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-17 14:00:11 |
合計ジャッジ時間 | 2,525 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll n,sum=0; cin >> n; if(n<2||10000000000<n) return 1; for(ll x=2;x*x<=n;x++){ ll y=2; while(0<x%y&&y*y<=x) y++; if(y<x&&x%y==0) continue; ll k=x*x; while(k<=n){ sum+=k; k*=x; } } cout << sum << endl; }