結果
問題 | No.677 10^Nの約数 |
ユーザー |
![]() |
提出日時 | 2018-05-14 01:09:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,098 bytes |
コンパイル時間 | 1,813 ms |
コンパイル使用メモリ | 175,156 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 10:49:33 |
合計ジャッジ時間 | 6,976 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 TLE * 1 -- * 1 |
ソースコード
#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);vector<long> v;long M = sqrt(N);for (long i = 1; i <= M; i++) {if (N % i == 0) {v.push_back(i);if (i != N / i)v.push_back(N / i);}}sort(v.begin(), v.end());for (auto x : v) {cout << x << endl;}}