結果

問題 No.29 パワーアップ
ユーザー ooh_20ooh_20
提出日時 2017-06-01 12:07:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 988 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 106,648 KB
実行使用メモリ 23,996 KB
最終ジャッジ日時 2023-10-21 20:12:43
合計ジャッジ時間 2,170 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,996 KB
testcase_01 AC 24 ms
23,996 KB
testcase_02 AC 25 ms
23,996 KB
testcase_03 AC 25 ms
23,996 KB
testcase_04 AC 23 ms
23,996 KB
testcase_05 AC 24 ms
23,996 KB
testcase_06 AC 23 ms
23,996 KB
testcase_07 AC 22 ms
23,996 KB
testcase_08 AC 23 ms
23,996 KB
testcase_09 AC 23 ms
23,996 KB
testcase_10 AC 24 ms
23,996 KB
testcase_11 AC 24 ms
23,996 KB
testcase_12 AC 25 ms
23,996 KB
testcase_13 AC 24 ms
23,996 KB
testcase_14 AC 25 ms
23,996 KB
testcase_15 AC 25 ms
23,996 KB
testcase_16 AC 24 ms
23,996 KB
testcase_17 AC 24 ms
23,996 KB
testcase_18 AC 23 ms
23,996 KB
testcase_19 AC 23 ms
23,996 KB
testcase_20 AC 23 ms
23,996 KB
testcase_21 AC 23 ms
23,996 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No._29
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[,] a = new int[N,3];
            int[] item = new int[11];
            int powerUp = 0;
            int remain = 0;

            for (int i = 0; i < N; i++)
            {
                string[] buff = Console.ReadLine().Split();
                a[i, 0] = int.Parse(buff[0]);
                a[i, 1] = int.Parse(buff[1]);
                a[i, 2] = int.Parse(buff[2]);
            }

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    item[a[i, j]]++;
                }
            }

            for (int i = 1; i <= 10; i++)
            {
                powerUp += item[i] / 2;
                remain += item[i] % 2;
            }

            powerUp += remain / 4;

            Console.WriteLine(powerUp);
        }
    }
}
0