Submission #18352356


Source Code Expand

Copy
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: usize,
        p: [usize; n],
    }
    let mut dp = vec![false; n * 100 + 1];
    dp[0] = true;
    for i in p {
        for j in (0..dp.len()).rev() {
            if i + j >= dp.len() {
                continue;
            }
            if dp[j] {
                dp[i + j] = true;
            }
        }
    }
    println!("{}", dp.into_iter().filter(|&x| x).count());
}

Submission Info

Submission Time
Task A - コンテスト
User mah_shee
Language Rust (1.42.0)
Score 2
Code Size 526 Byte
Status AC
Exec Time 4 ms
Memory 2080 KB

Judge Result

Set Name All
Score / Max Score 2 / 2
Status
AC × 5
Set Name Test Cases
All 00, 01, 02, 90, 91
Case Name Status Exec Time Memory
00 AC 1 ms 2072 KB
01 AC 1 ms 2080 KB
02 AC 4 ms 1980 KB
90 AC 1 ms 1948 KB
91 AC 1 ms 2072 KB