結果
| 問題 |
No.278 連続する整数の和(2)
|
| コンテスト | |
| ユーザー |
moti
|
| 提出日時 | 2015-12-04 02:30:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 672 bytes |
| コンパイル時間 | 875 ms |
| コンパイル使用メモリ | 88,520 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 12:24:00 |
| 合計ジャッジ時間 | 2,085 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 14 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
int main() {
ll N; cin >> N;
ll X = N % 2 ? N : N / 2;
ll Y = X;
ll res = 0;
for(ll x = 2; x*x<=Y; x++) {
if(Y % x == 0) {
res += x;
}
while(X % x == 0) X /= x;
}
if(X > 1) {
res += X;
}
cout << ++res << endl;
return 0;
}
moti