提出 #30188152


ソースコード 拡げる

use proconio::input;

fn gcd(n: usize, m: usize) -> usize {
    if m == 0 {
        n
    } else {
        gcd(m, n % m)
    }
}

fn main() {
    input! {
        a: usize,
        b: usize,
    };
    match (a / gcd(a, b)).checked_mul(b) {
        Some(x) if x <= 10_usize.pow(18) => println!("{}", x),
        Some(_) | None => println!("Large"),
    }
}

提出情報

提出日時
問題 093 - Large LCM(★3)
ユーザ bouzuya
言語 Rust (1.42.0)
得点 3
コード長 357 Byte
結果 AC
実行時間 6 ms
メモリ 2100 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 3 / 3
結果
AC × 3
AC × 45
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 6 ms 2016 KiB
hand_02.txt AC 2 ms 1928 KiB
hand_03.txt AC 3 ms 1920 KiB
hand_04.txt AC 1 ms 2048 KiB
hand_05.txt AC 3 ms 2080 KiB
hand_06.txt AC 4 ms 1920 KiB
hand_07.txt AC 2 ms 1960 KiB
hand_08.txt AC 1 ms 1852 KiB
hand_09.txt AC 2 ms 1920 KiB
hand_10.txt AC 2 ms 2064 KiB
hand_11.txt AC 3 ms 1988 KiB
hand_12.txt AC 1 ms 2068 KiB
hand_13.txt AC 2 ms 1984 KiB
hand_14.txt AC 1 ms 2020 KiB
hand_15.txt AC 4 ms 1912 KiB
hand_16.txt AC 1 ms 1920 KiB
hand_17.txt AC 1 ms 2040 KiB
random_01.txt AC 1 ms 1960 KiB
random_02.txt AC 1 ms 1984 KiB
random_03.txt AC 1 ms 2032 KiB
random_04.txt AC 1 ms 2016 KiB
random_05.txt AC 2 ms 2024 KiB
random_06.txt AC 1 ms 1992 KiB
random_07.txt AC 1 ms 1856 KiB
random_08.txt AC 1 ms 1992 KiB
random_09.txt AC 1 ms 1948 KiB
random_10.txt AC 1 ms 1928 KiB
random_11.txt AC 1 ms 1948 KiB
random_12.txt AC 1 ms 2012 KiB
random_13.txt AC 1 ms 2004 KiB
random_14.txt AC 2 ms 2076 KiB
random_15.txt AC 1 ms 1984 KiB
random_16.txt AC 2 ms 1964 KiB
random_17.txt AC 1 ms 2028 KiB
random_18.txt AC 1 ms 1984 KiB
random_19.txt AC 1 ms 2040 KiB
random_20.txt AC 3 ms 1924 KiB
random_21.txt AC 1 ms 1916 KiB
random_22.txt AC 2 ms 1968 KiB
random_23.txt AC 1 ms 1988 KiB
random_24.txt AC 1 ms 2024 KiB
random_25.txt AC 1 ms 1852 KiB
sample_01.txt AC 3 ms 2024 KiB
sample_02.txt AC 3 ms 2020 KiB
sample_03.txt AC 2 ms 2100 KiB