Submission #97305


Source Code Expand

using System;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;

public class E167
{
    public static void Main()
    {
        new E167().Entry();
    }//Main

    void Entry()
    {
        int N = intRead();
        int[]p = intSplit(' ');
        Dictionary<int, bool> can = new Dictionary<int, bool>();
        can[0] = true;
        for (int i = 0; i < p.Length; i++)
        {
            int cur = p[i];
            Dictionary<int, bool> next = new Dictionary<int, bool>();
            foreach (int t in can.Keys)
            {
                next[t] = next[t + cur] = true;
            }//foreach t
            can = next;
        }//for i
        Console.WriteLine(can.Count);
    }





    string strRead()
    {
        return Console.ReadLine();
    }

    int intRead()
    {
        return int.Parse(Console.ReadLine());
    }

    long longRead()
    {
        return long.Parse(Console.ReadLine());
    }

    double doubleRead()
    {
        return double.Parse(Console.ReadLine());
    }

    string[] strSplit(char a)
    {
        return Console.ReadLine().Split(a);
    }

    int[] intSplit(char a)
    {
        return Array.ConvertAll<string, int>(Console.ReadLine().Split(new char[] { a }, StringSplitOptions.RemoveEmptyEntries), int.Parse);
    }

    long[] longSplit(char a)
    {
        return Array.ConvertAll<string, long>(Console.ReadLine().Split(new char[] { a }, StringSplitOptions.RemoveEmptyEntries), long.Parse);
    }

    double[] doubleSplit(char a)
    {
        return Array.ConvertAll<string, double>(Console.ReadLine().ToString().Split(new char[] { a }, StringSplitOptions.RemoveEmptyEntries), double.Parse);
    }


}//Template

Submission Info

Submission Time
Task A - コンテスト
User utmath
Language C# (Mono 2.10.8.1)
Score 2
Code Size 1801 Byte
Status AC
Exec Time 199 ms
Memory 8812 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 152 ms 8212 KB
01 AC 162 ms 8596 KB
02 AC 199 ms 8812 KB
90 AC 151 ms 8208 KB
91 AC 149 ms 8204 KB