Submission #3232365


Source Code Expand

using System;
class Program
{
	static void Main()
	{
	int n = int.Parse(Console.ReadLine());
	int[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
  int answer = 0;
  bool[] answers = new bool[11000];
  for(int i = 0; i < answers.Length; i++) answers[i] = false;
  answers[0] = true;

    for(int i = 0; i < n; i++)
    {
      for(int j = 10000; j >= 0; j--)
      {
        if(answers[j]) answers[j+nums[i]] = true;
      }
    }

    for(int i = 0; i < answers.Length; i++)
    {
    if(answers[i]) answer++;
    }
  
  
	Console.WriteLine(answer);
	}
}

Submission Info

Submission Time
Task A - コンテスト
User suikameron
Language C# (Mono 4.6.2.0)
Score 2
Code Size 603 Byte
Status AC
Exec Time 21 ms
Memory 11200 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 21 ms 11072 KB
01 AC 21 ms 9024 KB
02 AC 21 ms 9024 KB
90 AC 21 ms 11200 KB
91 AC 20 ms 11072 KB