結果
問題 |
No.1737 One to N
|
ユーザー |
|
提出日時 | 2023-05-04 19:00:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 674 ms |
コンパイル使用メモリ | 81,224 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 10:34:37 |
合計ジャッジ時間 | 1,894 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<ctime> #include<string> #include<algorithm> #include<vector> #include<queue> #include<stack> #include<map> using namespace std; typedef long long LL; const int MR=1e6+10; int n; int main(){ cin>>n; int ans=0; for(int i=2;i*i<=n;i++){ if(n%i!=0) continue; while(n%i==0){ ans+=i; n/=i; } } if(n>1) ans+=n; cout<<ans<<endl; return 0; }