結果

問題 No.29 パワーアップ
ユーザー mencottonmencotton
提出日時 2017-12-25 21:33:07
言語 C#
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 814 bytes
コンパイル時間 1,904 ms
使用メモリ 15,832 KB
最終ジャッジ日時 2023-01-09 17:18:09
合計ジャッジ時間 4,806 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 58 ms
15,732 KB
testcase_01 AC 58 ms
15,684 KB
testcase_02 AC 59 ms
15,764 KB
testcase_03 AC 60 ms
15,588 KB
testcase_04 AC 59 ms
15,628 KB
testcase_05 AC 57 ms
15,660 KB
testcase_06 AC 59 ms
15,764 KB
testcase_07 AC 57 ms
15,524 KB
testcase_08 AC 58 ms
15,656 KB
testcase_09 AC 58 ms
15,604 KB
testcase_10 AC 58 ms
15,668 KB
testcase_11 AC 57 ms
15,832 KB
testcase_12 AC 58 ms
15,668 KB
testcase_13 AC 58 ms
15,708 KB
testcase_14 AC 57 ms
15,596 KB
testcase_15 AC 58 ms
15,612 KB
testcase_16 AC 61 ms
15,724 KB
testcase_17 AC 59 ms
15,524 KB
testcase_18 AC 58 ms
15,724 KB
testcase_19 AC 58 ms
15,656 KB
testcase_20 AC 58 ms
15,776 KB
testcase_21 AC 59 ms
15,716 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace template
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] item = new int[11];
            for (int i = 0; i < n; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                for (int j = 0; j < 3; j++)
                {
                    item[x[j]]++;
                }
            }
            int ret = 0;
            for (int i = 1; i <= 10; i++)
            {
                ret += item[i] / 2;
                item[i] %= 2;
            }
            ret += item.Sum() / 4;
            Console.WriteLine(ret);
        }
    }
}
0