結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-04-29 15:12:59 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 30 ms / 5,000 ms | 
| コード長 | 716 bytes | 
| コンパイル時間 | 2,468 ms | 
| コンパイル使用メモリ | 115,200 KB | 
| 実行使用メモリ | 28,076 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:14:32 | 
| 合計ジャッジ時間 | 2,361 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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;
class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] list = new int[n * 3];
        for(int i = 0; i < n; i++)
        {
            int[] num = Console.ReadLine().Split().Select(a => int.Parse(a)).ToArray();
            for(int j = 0; j < 3; j++)
            {
                list[i * 3 + j] = num[j];
            }
        }
        Array.Sort(list);
        int pair = 0;
        for(int i = 1; i < list.Length; i++)
        {
            if(list[i - 1] == list[i])
            {
                pair++;
                i++;
            }
        }
        Console.WriteLine($"{pair + (list.Length - pair * 2) / 4}");
    }
}
            
            
            
        