結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-22 16:35:30 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 33 ms / 5,000 ms | 
| コード長 | 923 bytes | 
| コンパイル時間 | 899 ms | 
| コンパイル使用メモリ | 115,080 KB | 
| 実行使用メモリ | 28,044 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:15:06 | 
| 合計ジャッジ時間 | 2,399 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
namespace _0029
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = new Dictionary<int,int>();
            var p = 0;
            for(var i = 0; i < n; i++){
                var t = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                for(var j = 0; j < 3; j++){
                    var m = t[j];
                    if(d.ContainsKey(m)){
                        d[m] += 1;
                        if(d[m] == 2){
                            p += 1;
                            d[m] = 0;
                        }
                    }else{
                        d.Add(m,1);
                    }
                }
            }
            var s = d.Sum(x => x.Value);
            Console.WriteLine(s / 4 + p);
        }
    }
}
            
            
            
        