結果

問題 No.278 連続する整数の和(2)
ユーザー stack9996stack9996
提出日時 2015-09-04 23:34:18
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 1,142 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 72,468 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 22:38:32
合計ジャッジ時間 1,456 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 13 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 12 ms
4,380 KB
testcase_10 AC 15 ms
4,380 KB
testcase_11 AC 12 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 10 ms
4,376 KB
testcase_14 AC 8 ms
4,376 KB
testcase_15 AC 9 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <numeric>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <cmath>
#include <queue>
#include <set>

#define rep(i, a) REP(i, 0, a)
#define REP(i, a, b) for(int i = a; i < b; ++i)

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> P;
typedef std::pair<P, int> PP;
struct edge{ int to, time, cost; };
const double esp = 1e-9;

struct Node{
	int r = 0, l = 0;
	Node* parent = nullptr;
	std::vector<Node*> child;
};

ll n;
/*Node node[100001];

void down(Node &n, int k){
	n.r = k;
	int s = n.child.size();
	if (s == 0)return;
	else{
		rep(i, s)down(*n.child[i], k + 1);
	}
}

int main(){
	std::cin >> n;
	rep(i, n){
		int x, y;
		std::cin >> x >> y;
		node[x - 1].child.push_back(&node[y]);
	}
	rep(i, n){
		int s = node[i].child.size();
		if (){
			int s = node[i]
		}
	}
	return 0;
}*/

int main(){
	ll ans = 0;
	std::cin >> n;
	n = (n % 2 == 0 ? n / 2 : n);
	for (ll i = 1; i * i <= n; ++i){
		if (n % i == 0){
			ans += i;
			ans += n / i;
			if (i == n / i)ans -= n / i;
		}
	}
	std::cout << ans << std::endl;
	return 0;
}
0