Submission #18356461


Source Code Expand

Copy
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::*,
    std::{cmp::*, collections::*, convert::*, iter::*, marker::*, mem::*, ops::*},
};
/*
    ■
*/
#[fastout]
fn main() {
    input! {//
        n:usize,
        p:[usize;n],
    }
    let mut dp = vec![false; n * 102 + 333];
    dp[0] = true;
    for &x in p.iter() {
        for i in (0..=n * 100).rev() {
            dp[i + x] |= dp[i];
        }
    }
    println!("{}", dp.iter().filter(|&&x| x).count());
}

Submission Info

Submission Time
Task A - コンテスト
User yvay5cqe
Language Rust (1.42.0)
Score 2
Code Size 531 Byte
Status AC
Exec Time 7 ms
Memory 2160 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 7 ms 2060 KB
01 AC 1 ms 2088 KB
02 AC 4 ms 2084 KB
90 AC 1 ms 1996 KB
91 AC 1 ms 2160 KB