結果

問題 No.29 パワーアップ
ユーザー mbanmban
提出日時 2016-11-04 17:14:54
言語 C#
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 2,067 ms
使用メモリ 15,832 KB
最終ジャッジ日時 2022-12-30 05:02:55
合計ジャッジ時間 4,634 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 58 ms
15,656 KB
testcase_01 AC 59 ms
15,584 KB
testcase_02 AC 59 ms
15,728 KB
testcase_03 AC 58 ms
15,720 KB
testcase_04 AC 58 ms
15,624 KB
testcase_05 AC 59 ms
15,728 KB
testcase_06 AC 58 ms
15,780 KB
testcase_07 AC 58 ms
15,664 KB
testcase_08 AC 59 ms
15,788 KB
testcase_09 AC 58 ms
15,724 KB
testcase_10 AC 58 ms
15,712 KB
testcase_11 AC 58 ms
15,744 KB
testcase_12 AC 58 ms
15,564 KB
testcase_13 AC 58 ms
15,672 KB
testcase_14 AC 58 ms
15,784 KB
testcase_15 AC 58 ms
15,824 KB
testcase_16 AC 58 ms
15,832 KB
testcase_17 AC 58 ms
15,656 KB
testcase_18 AC 58 ms
15,736 KB
testcase_19 AC 58 ms
15,520 KB
testcase_20 AC 58 ms
15,732 KB
testcase_21 AC 60 ms
15,560 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;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int[] item = new int[10];
        int cnt = 0;
        for(int i = 0; i < N; i++)
        {
            int[] q = Console.ReadLine().Split(' ').Select(s => int.Parse(s) - 1).ToArray();
            for(int j = 0; j < 3; j++)
            {
                item[q[j]]++;
            }
        }
        for(int i = 0; i < 10; i++)
        {
            cnt += item[i] / 2;
            item[i] %= 2;
        }
        cnt += item.Sum() / 4;
        Console.WriteLine(cnt);
    }
}
0