Submission #620443


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static string ReadLine() { return Console.ReadLine(); }
    static int ReadInt() { return int.Parse(ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    static int Calc(int[] xs) {
        var dp = new bool[100 * xs.Length + 1];
        dp[0] = true;
        foreach (int x in xs) {
            for (int i = dp.Length-1; i >= 0; i--) {
                if (dp[i]) {
                    dp[i+x] = true;
                }
            }
        }
        return dp.Count(e => e);
    }

    static void Main() {
        ReadLine();
        var xs = ReadInts();
        Console.WriteLine(Calc(xs));
    }
}

Submission Info

Submission Time
Task A - コンテスト
User noriok
Language C# (Mono 2.10.8.1)
Score 2
Code Size 838 Byte
Status AC
Exec Time 187 ms
Memory 8796 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 187 ms 8776 KB
01 AC 125 ms 8792 KB
02 AC 125 ms 8796 KB
90 AC 133 ms 8668 KB
91 AC 133 ms 8668 KB