結果

問題 No.537 ユーザーID
ユーザー treeone
提出日時 2017-06-11 17:03:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 689 bytes
コンパイル時間 1,178 ms
コンパイル使用メモリ 161,524 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-04 16:59:35
合計ジャッジ時間 2,454 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;

string change_to_s(int n){
	stringstream ss; ss<<n;
	return ss.str();
}

int solve(int n){
	// set<string> st;
	int ans = 0;
	for(int i = 1; i * i <= n; i++){
		if(n % i == 0){
			if(i * i == n) ans++;
			else ans += 2;
			// st.insert(change_to_s(n / i) + change_to_s(i));
			// st.insert(change_to_s(i) + change_to_s(n / i));
			// cout << change_to_s(n / i) + change_to_s(i) << " " << change_to_s(i) + change_to_s(n / i) << endl;
		}
	}
	return ans;
	// return st.size();
}

signed main(){
	int n;
	cin >> n;
	assert(0 <= n && n <= (1e12));
	cout << solve(n) << endl;
}
0