Submission #15522517


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: usize,
    };
    let mut ans = true;
    for i in 2..n {
        if n % i == 0 {
            ans = false;
            break;
        }
    }
    println!("{}", if ans { "YES" } else { "NO" });
}

Submission Info

Submission Time
Task A - 素数、コンテスト、素数
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 254 Byte
Status
Exec Time 20 ms
Memory 2052 KB

Judge Result

Set Name Score / Max Score Test Cases
All 100 / 100 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt
Case Name Status Exec Time Memory
00_sample_01.txt 6 ms 1988 KB
00_sample_02.txt 1 ms 1988 KB
00_sample_03.txt 12 ms 1928 KB
00_sample_04.txt 2 ms 2052 KB
01_test_01.txt 2 ms 1924 KB
01_test_02.txt 1 ms 1844 KB
01_test_03.txt 20 ms 1984 KB
01_test_04.txt 16 ms 1848 KB
01_test_05.txt 2 ms 1968 KB
01_test_06.txt 1 ms 1928 KB
01_test_07.txt 2 ms 1992 KB
01_test_08.txt 1 ms 1908 KB
01_test_09.txt 2 ms 1924 KB
01_test_10.txt 13 ms 1908 KB
01_test_11.txt 1 ms 1972 KB
01_test_12.txt 2 ms 1924 KB
01_test_13.txt 2 ms 2044 KB
01_test_14.txt 10 ms 1956 KB
01_test_15.txt 1 ms 1924 KB
01_test_16.txt 2 ms 2036 KB
01_test_17.txt 2 ms 1968 KB
01_test_18.txt 2 ms 1928 KB
01_test_19.txt 2 ms 1924 KB
01_test_20.txt 2 ms 1932 KB
01_test_21.txt 2 ms 1984 KB
01_test_22.txt 2 ms 2036 KB
01_test_23.txt 1 ms 1984 KB
01_test_24.txt 2 ms 1960 KB
01_test_25.txt 2 ms 1968 KB