結果

問題 No.677 10^Nの約数
ユーザー zaichuzaichu
提出日時 2018-05-14 00:54:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,041 bytes
コンパイル時間 1,577 ms
コンパイル使用メモリ 173,516 KB
実行使用メモリ 8,456 KB
最終ジャッジ日時 2023-09-10 19:42:33
合計ジャッジ時間 7,485 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 5 ms
4,376 KB
testcase_12 AC 12 ms
4,384 KB
testcase_13 AC 35 ms
4,376 KB
testcase_14 AC 107 ms
4,376 KB
testcase_15 AC 331 ms
4,376 KB
testcase_16 AC 1,042 ms
4,376 KB
testcase_17 TLE -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}

vector<int> p;
vector<int> r;

void init(int n) {
  p.reserve(n);
  r.resize(n);
  for (int i = 0; i < n; i++) {
    p[i] = i;
    r[i] = 0;
  }
}

int root(int x) { return p[x] == x ? x : p[x] = root(p[x]); }

bool same(int x, int y) { return root(x) == root(y); }

void unite(int x, int y) {
  x = root(x);
  y = root(y);
  if (x == y)
    return;

  if (r[x] < r[y])
    p[x] = y;
  else {
    p[y] = x;
    if (r[x] == r[y])
      r[x]++;
  }
}

int main() {
  long N;
  cin >> N;
  N = pow(10, N);

  set<long> st;
  long M = sqrt(N);
  for (long i = 1; i <= M; i++) {
    if (N % i == 0) {
      st.insert(i);
      st.insert(N / i);
    }
  }
  for (auto x : st) {
    cout << x << endl;
  }
}
0