結果

問題 No.677 10^Nの約数
ユーザー ElkElk
提出日時 2018-07-21 18:29:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 1,347 ms
コンパイル使用メモリ 166,380 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-08-27 00:41:28
合計ジャッジ時間 7,004 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 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,380 KB
testcase_12 AC 13 ms
4,376 KB
testcase_13 AC 32 ms
4,376 KB
testcase_14 AC 97 ms
4,376 KB
testcase_15 AC 313 ms
4,380 KB
testcase_16 AC 984 ms
4,376 KB
testcase_17 TLE -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    vector <long long int> num(pow(19, 2), 0);
    long long tmp, i, max;
    int N, cnt, cnt2 = 0;

    cin >> N;
    max = pow(10, N);
    tmp = max;
    cnt = pow(N + 1, 2) - 1;

    for(i = 1; i < max; i++){
        if(tmp%i == 0){
            num[cnt2++] = i;
            if(i != tmp/i){
                num[cnt--] = tmp/i;
                max = tmp/i;
            }
        }
    }

    for(i = 0; i < pow(N + 1, 2); i++){
        cout << num[i] << endl;
    }

    return 0;
}
0