Submission #3591580


Source Code Expand

using System;

namespace AtCoder
{
    class B_KagamiMochi085
    {
        public static void Main()
        {
            var N = int.Parse(Console.ReadLine());
            var map = new Map<int>(N);
            for (var i = 0; i < N; ++i)
            {
                map.Add(int.Parse(Console.ReadLine()));
            }
            Console.WriteLine(map.Length);
        }

        private class Map<T> where T : IComparable
        {
            public int Length { get; private set; }
            private T[] array = null;

            public Map(int _size)
            {
                this.Length = 0;
                this.array = new T[_size];
            }

            public void Add(T _value)
            {
                if (this.Find(_value)) { return; }

                this.array[this.Length] = _value;
                ++this.Length;
            }

            private bool Find(T _value)
            {
                for (var i = 0; i < this.Length; ++i)
                {
                    if (_value.Equals(this.array[i])) { return true; }
                }
                return false;
            }
        }
    }
}

Submission Info

Submission Time
Task B - Kagami Mochi
User flanny7
Language C# (Mono 4.6.2.0)
Score 200
Code Size 1195 Byte
Status AC
Exec Time 21 ms
Memory 13140 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 20 ms 9044 KB
a02 AC 20 ms 11092 KB
a03 AC 21 ms 11092 KB
b04 AC 21 ms 13140 KB
b05 AC 20 ms 9044 KB
b06 AC 21 ms 11092 KB
b07 AC 21 ms 11092 KB
b08 AC 20 ms 9044 KB
b09 AC 20 ms 9044 KB
b10 AC 20 ms 9044 KB
b11 AC 21 ms 11092 KB
b12 AC 21 ms 11092 KB
b13 AC 21 ms 9172 KB