結果

問題 No.677 10^Nの約数
ユーザー nekoziroonekoziroo
提出日時 2018-05-26 19:13:34
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 1,018 ms
コンパイル使用メモリ 146,532 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2023-09-11 03:42:39
合計ジャッジ時間 8,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

use std::i64;
use std::io::stdin;

fn get_line() -> String {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    line
}

fn main() {
    let line = get_line();
    let n: u32 = line.trim().parse().unwrap();
    let ten: i64 = 10;
    let p: i64 = ten.pow(n);
    let mut s: i64 = 1;

    let mut result = Vec::new();
    loop {
        if s >= p / s {
            result.push(s);
            break;
        }
        if p % s == 0 {
            result.push(s);
            result.push(p / s);
            s += 1;
        } else {
            s += 1;
        }
    }

    result.sort();

    for i in result {
        println!("{}", i)
    }
}
0