結果

問題 No.677 10^Nの約数
ユーザー ManjushriMitra
提出日時 2024-07-27 20:21:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 594 bytes
コンパイル時間 1,931 ms
コンパイル使用メモリ 174,688 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-27 20:22:03
合計ジャッジ時間 2,875 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)

int main(){
    int N;
    cin >> N;

    vector<ll> pow2(20, 1LL), pow5(20, 1LL);
    for(int i=1; i<=18; ++i){
        pow2[i] = pow2[i-1] * 2LL;
        pow5[i] = pow5[i-1] * 5LL;
    }

    vector<ll> ans;
    for(int i=0; i<=N; ++i){
        for(int j=0; j<=N; ++j){
            ans.push_back(pow2[i]*pow5[j]);
        }
    }

    sort(ans.begin(), ans.end());

    for(ll a : ans){
        cout << a << endl;
    }
    
    return 0;
}
0