結果

問題 No.537 ユーザーID
ユーザー koba-e964
提出日時 2017-07-22 20:57:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 70,860 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-09 10:00:37
合計ジャッジ時間 2,439 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;

string calc(ll a, ll b) {
  stringstream ss;
  ss << a << b;
  return ss.str();
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  set<string> cand;
  REP(i, 1, 1.1e6) {
    if (n % i == 0) {
      cand.insert(calc(i, n / i));
      cand.insert(calc(n / i, i));
    }
  }
  cout << cand.size() << "\n";
}
0