結果

問題 No.278 連続する整数の和(2)
ユーザー Twizz
提出日時 2017-05-21 10:18:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 400 bytes
コンパイル時間 1,211 ms
コンパイル使用メモリ 157,664 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 08:03:44
合計ジャッジ時間 4,591 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include"bits/stdc++.h"

//#include<bits/stdc++.h>
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
typedef long long ll;
const ll mod = 10000000000;

int main() {
	ll n;
	cin >> n;
	ll ans = 0;
	for (int i = 1; i*i <= n; i++) {
		if (n%i == 0) {
			ans += i;
		}
	}
	if (n % 2 == 1)ans += n;
	print(ans);
	return 0;
}
0