結果

問題 No.537 ユーザーID
ユーザー Mcpu3
提出日時 2019-02-14 14:52:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 820 ms
コンパイル使用メモリ 83,364 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 11:25:05
合計ジャッジ時間 2,041 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main() {
	long N;
	cin >> N;
	long i;
	vector<pair<long, long>> tmp1;
	set<string> tmp2;
	for (i = 1; i * i < N; ++i) {
		if (N % i == 0) {
			tmp1.push_back(make_pair(i, N / i));
			tmp2.insert(to_string(i) + to_string(N / i));
		}
	}
	for (pair<long, long>& i : tmp1) {
		tmp2.insert(to_string(i.second) + to_string(i.first));
	}
	if (N % (i * i) == 0) cout << tmp2.size() + 1;
	else cout << tmp2.size();
}
0