Submission #16810090


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: usize,
    };
    let mut sum = 0_usize;
    for i in 1.. {
        if i * i > n {
            break;
        }
        if n % i == 0 {
            sum += i;
            if i != n / i {
                sum += n / i;
            }
        }
    }
    sum -= n;
    let ans = if n == sum {
        "Perfect"
    } else if n > sum {
        "Deficient"
    } else if n < sum {
        "Abundant"
    } else {
        unreachable!();
    };
    println!("{}", ans);
}

Submission Info

Submission Time
Task B - 完全数
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 522 Byte
Status AC
Exec Time 9 ms
Memory 2176 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 50 / 50 50 / 50
Status
AC × 4
AC × 28
AC × 49
Set Name Test Cases
Sample sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
Subtask1 sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt
Subtask2 sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt
Case Name Status Exec Time Memory
sample_1.txt AC 9 ms 2080 KB
sample_2.txt AC 2 ms 2020 KB
sample_3.txt AC 2 ms 2044 KB
sample_4.txt AC 1 ms 2104 KB
subtask1_01.txt AC 1 ms 1908 KB
subtask1_02.txt AC 2 ms 2004 KB
subtask1_03.txt AC 1 ms 2044 KB
subtask1_04.txt AC 1 ms 2176 KB
subtask1_05.txt AC 1 ms 2104 KB
subtask1_06.txt AC 2 ms 2000 KB
subtask1_07.txt AC 1 ms 1984 KB
subtask1_08.txt AC 2 ms 1980 KB
subtask1_09.txt AC 1 ms 2104 KB
subtask1_10.txt AC 1 ms 2020 KB
subtask1_11.txt AC 2 ms 2088 KB
subtask1_12.txt AC 1 ms 1908 KB
subtask1_13.txt AC 2 ms 2040 KB
subtask1_14.txt AC 1 ms 1968 KB
subtask1_15.txt AC 1 ms 1984 KB
subtask1_16.txt AC 1 ms 2056 KB
subtask1_17.txt AC 1 ms 2116 KB
subtask1_18.txt AC 1 ms 2088 KB
subtask1_19.txt AC 1 ms 2024 KB
subtask1_20.txt AC 1 ms 2020 KB
subtask1_21.txt AC 3 ms 1912 KB
subtask1_22.txt AC 2 ms 1968 KB
subtask1_23.txt AC 1 ms 2036 KB
subtask1_24.txt AC 1 ms 2032 KB
subtask2_01.txt AC 2 ms 1972 KB
subtask2_02.txt AC 5 ms 2096 KB
subtask2_03.txt AC 2 ms 2032 KB
subtask2_04.txt AC 2 ms 2028 KB
subtask2_05.txt AC 2 ms 2060 KB
subtask2_06.txt AC 1 ms 2056 KB
subtask2_07.txt AC 2 ms 2176 KB
subtask2_08.txt AC 3 ms 1980 KB
subtask2_09.txt AC 2 ms 2000 KB
subtask2_10.txt AC 2 ms 2032 KB
subtask2_11.txt AC 1 ms 2048 KB
subtask2_12.txt AC 2 ms 2132 KB
subtask2_13.txt AC 2 ms 2032 KB
subtask2_14.txt AC 2 ms 2076 KB
subtask2_15.txt AC 2 ms 1900 KB
subtask2_16.txt AC 2 ms 2036 KB
subtask2_17.txt AC 2 ms 2116 KB
subtask2_18.txt AC 2 ms 1972 KB
subtask2_19.txt AC 2 ms 2120 KB
subtask2_20.txt AC 2 ms 2088 KB
subtask2_21.txt AC 2 ms 1980 KB