結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-10-26 16:55:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 2,000 ms |
| コード長 | 833 bytes |
| コンパイル時間 | 900 ms |
| コンパイル使用メモリ | 71,448 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-19 06:22:22 |
| 合計ジャッジ時間 | 2,398 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;
typedef unsigned long long ull;
int main() {
ull n=0;
cin >> n;
ull rn = static_cast<ull>(sqrt(n));
unsigned int count=0;
vector<string> set(1,"0");//候補を記憶する配列
for (int i = 1;i <= rn;i++) {
double ans = n / i;
if (n%i!=0)continue;//制数でないならば、先頭に戻る
string str1 = to_string(i);
string str2 = to_string(static_cast<ull>(ans));
auto itr1 = find(set.begin(),set.end(),str1+str2);
if (itr1 == set.end()) {
string buff = str1 + str2;
set.push_back(buff);
count++;
}
auto itr2 = find(set.begin(),set.end(),str2+str1);
if (itr2 == set.end()) {
string buff = str2 + str1;
set.push_back(buff);
count++;
}
}
cout << count;
return 0;
}