結果

問題 No.29 パワーアップ
ユーザー mbanmban
提出日時 2016-11-04 17:14:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 101,768 KB
実行使用メモリ 23,680 KB
最終ジャッジ日時 2023-08-16 13:46:50
合計ジャッジ時間 4,619 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,680 KB
testcase_01 AC 59 ms
21,624 KB
testcase_02 AC 59 ms
21,488 KB
testcase_03 AC 61 ms
23,652 KB
testcase_04 AC 59 ms
23,672 KB
testcase_05 AC 60 ms
21,548 KB
testcase_06 AC 58 ms
21,496 KB
testcase_07 AC 60 ms
23,592 KB
testcase_08 AC 59 ms
23,568 KB
testcase_09 AC 61 ms
23,540 KB
testcase_10 AC 58 ms
23,628 KB
testcase_11 AC 59 ms
21,572 KB
testcase_12 AC 59 ms
19,616 KB
testcase_13 AC 59 ms
21,580 KB
testcase_14 AC 60 ms
23,620 KB
testcase_15 AC 60 ms
21,592 KB
testcase_16 AC 59 ms
23,552 KB
testcase_17 AC 61 ms
23,628 KB
testcase_18 AC 60 ms
23,564 KB
testcase_19 AC 60 ms
23,668 KB
testcase_20 AC 60 ms
21,588 KB
testcase_21 AC 58 ms
21,584 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