Submission #16603840


Source Code Expand

Copy
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        _: usize,
        s: Chars,
    };
    let mut count = 0;
    for i in 0..=999 {
        let d = format!("{:03}", i).chars().collect::<Vec<char>>();
        let mut j = 0;
        for &s_i in s.iter() {
            if j == 3 {
                break;
            }
            if d[j] == s_i {
                j += 1;
            }
        }
        if j == 3 {
            count += 1;
        }
    }
    let ans = count;
    println!("{}", ans);
}

Submission Info

Submission Time
Task D - Lucky PIN
User bouzuya
Language Rust (1.42.0)
Score 400
Code Size 533 Byte
Status
Exec Time 80 ms
Memory 2348 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
× 3
× 33
Set Name Test Cases
Sample 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt
All 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-corner-01.txt, 01-corner-02.txt, 01-corner-03.txt, 01-corner-04.txt, 02-random-01.txt, 02-random-02.txt, 02-random-03.txt, 02-random-04.txt, 02-random-05.txt, 02-random-06.txt, 02-random-07.txt, 03-random-x-01.txt, 03-random-x-02.txt, 03-random-x-03.txt, 04-expand-01.txt, 04-expand-02.txt, 04-expand-03.txt, 04-expand-04.txt, 04-expand-05.txt, 04-expand-06.txt, 04-expand-07.txt, 04-expand-08.txt, 05-limiting-01.txt, 05-limiting-02.txt, 05-limiting-03.txt, 05-limiting-04.txt, 05-limiting-05.txt, 05-limiting-06.txt, 05-limiting-07.txt, 05-limiting-08.txt
Case Name Status Exec Time Memory
00-sample-01.txt 7 ms 2044 KB
00-sample-02.txt 2 ms 2116 KB
00-sample-03.txt 2 ms 2132 KB
01-corner-01.txt 2 ms 2128 KB
01-corner-02.txt 2 ms 2052 KB
01-corner-03.txt 2 ms 2052 KB
01-corner-04.txt 2 ms 2064 KB
02-random-01.txt 2 ms 2064 KB
02-random-02.txt 2 ms 2108 KB
02-random-03.txt 2 ms 1908 KB
02-random-04.txt 2 ms 1984 KB
02-random-05.txt 3 ms 1980 KB
02-random-06.txt 2 ms 2032 KB
02-random-07.txt 2 ms 2240 KB
03-random-x-01.txt 34 ms 2100 KB
03-random-x-02.txt 48 ms 2264 KB
03-random-x-03.txt 60 ms 2348 KB
04-expand-01.txt 77 ms 2280 KB
04-expand-02.txt 77 ms 2260 KB
04-expand-03.txt 80 ms 2196 KB
04-expand-04.txt 73 ms 2208 KB
04-expand-05.txt 70 ms 2316 KB
04-expand-06.txt 50 ms 2324 KB
04-expand-07.txt 44 ms 2292 KB
04-expand-08.txt 14 ms 2236 KB
05-limiting-01.txt 76 ms 2208 KB
05-limiting-02.txt 76 ms 2128 KB
05-limiting-03.txt 72 ms 2268 KB
05-limiting-04.txt 62 ms 2284 KB
05-limiting-05.txt 33 ms 2212 KB
05-limiting-06.txt 21 ms 2140 KB
05-limiting-07.txt 6 ms 2228 KB
05-limiting-08.txt 3 ms 2256 KB