結果

問題 No.537 ユーザーID
ユーザー tnakao0123
提出日時 2017-07-08 02:07:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 994 bytes
コンパイル時間 989 ms
コンパイル使用メモリ 91,508 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-06 10:16:02
合計ジャッジ時間 1,735 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 537.cc: No.537 ユーザーID - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef long long ll;
typedef set<ll> sll;

/* global variables */

sll used;

/* subroutines */

inline ll cc(ll x, ll y) {
  ll t = 10;
  while (t <= y) t *= 10;
  return x * t + y;
}

/* main */

int main() {
  ll n;
  cin >> n;

  ll cnt = 0;
  for (ll x = 1; x * x <= n; x++)
    if (n % x == 0) {
      ll y = n / x;
      ll a = cc(x, y), b = cc(y, x);

      if (used.find(a) == used.end()) {
	cnt++;
	used.insert(a);
      }
      if (used.find(b) == used.end()) {
	cnt++;
	used.insert(b);
      }
    }

  printf("%lld\n", cnt);
  return 0;
}
0