結果

問題 No.677 10^Nの約数
ユーザー uxux
提出日時 2024-03-03 04:28:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,883 bytes
コンパイル時間 2,226 ms
コンパイル使用メモリ 232,988 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-09-29 16:43:38
合計ジャッジ時間 7,445 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>    // tree
#include <ext/pb_ds/tree_policy.hpp>        // tree
/* // 多倍長整数
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using Bint = cpp_int;
*/
using namespace std;
using namespace __gnu_pbds;                 // tree
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<long long>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vd = vector<double>;
using vld = vector<long double>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using vvb = vector<vector<bool>>;
using vvd = vector<vector<double>>;
using vvld = vector<vector<long double>>;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<long long, long long>>;
using vpcc = vector<pair<char, char>>;
using vpss = vector<pair<string, string>>;
using sti = set<int>;
using stl = set<long, long>;
using stc = set<char>;
using sts = set<string>;
using primax_int = priority_queue<int>;
using primin_int = priority_queue<int, vector<int>, greater<int>>;
using primax_ll = priority_queue<ll>;
using primin_ll = priority_queue<ll, vector<ll>, greater<ll>>;
using primax_char = priority_queue<char>;
using primin_char = priority_queue<char, vector<char>, greater<char>>;
using primax_string = priority_queue<string>;
using primin_string = priority_queue<string, vector<string>, greater<string>>;
using tree_int = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
using tree_ll = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;
using tree_char = tree<char, null_type, less<char>, rb_tree_tag, tree_order_statistics_node_update>;
using tree_string = tree<string, null_type, less<string>, rb_tree_tag, tree_order_statistics_node_update>;

#define endl "\n"
#define YES printf("YES\n");
#define Yes printf("Yes\n");
#define NO printf("NO\n");
#define No printf("No\n");
#define rep0(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define ALL(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int INF = 1e9;
const int MININF = -1e9;
const ll LINF = 1e18;
const ll MINLINF = -1e18;
const int MOD = 1e9 + 7;
const int MODD = 998244353;
const char MARU = 'o';
const char BATU = 'x';

// 8方向(4方向ならN=4で止め。)
vi vx = {0, 1, 0, -1, 1, -1, 1, -1};
vi vy = {1, 0, -1, 0, 1, -1, -1, 1};

template <class T>
bool chmax(T &a, const T& b){
    if(a < b){a = b;return true;}
    return false;
}

template <typename T>
bool chmin(T &a, const T& b){
    if(a > b){a = b;return true;}
    return false;
}

// 切り捨て(A/B以下の最大の整数)
template <class T>
T div_floor(T a, T b) {
    if (b < 0) a = -a, b = -b;
    return a >= 0 ? a / b : (a + 1) / b - 1;
}

// 切り上げ(A/B以上の最小の整数)
template <class T>
T div_ceil(T a, T b) {
    if (b < 0) a = -a, b = -b;
    return a > 0 ? (a - 1) / b + 1 : a / b;
}

template <typename T>
vl divisor(T N){
    vl ans;

    for(ll i = 1; i * i <= N; i++){
        if(N % i != 0)continue;

        ans.push_back(i);
        if(N / i != i)ans.push_back(N / i);
    }
    sort(ans.begin(), ans.end());
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N; cin>>N;
    ll X=10;
    while(N>1){
        X*=10;
        N--;
    }
    vl ans=divisor(X);

    for(auto i:ans)cout<<i<<endl;
}
0