結果

問題 No.29 パワーアップ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-28 12:03:02
言語 C#
(csc 3.9.0)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 718 bytes
コンパイル時間 1,913 ms
使用メモリ 15,740 KB
最終ジャッジ日時 2023-02-08 01:49:54
合計ジャッジ時間 4,927 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 77 ms
15,532 KB
testcase_01 AC 76 ms
15,456 KB
testcase_02 AC 77 ms
15,660 KB
testcase_03 AC 76 ms
15,596 KB
testcase_04 AC 76 ms
15,452 KB
testcase_05 AC 77 ms
15,660 KB
testcase_06 AC 76 ms
15,620 KB
testcase_07 AC 77 ms
15,480 KB
testcase_08 AC 77 ms
15,552 KB
testcase_09 AC 77 ms
15,548 KB
testcase_10 AC 78 ms
15,640 KB
testcase_11 AC 77 ms
15,476 KB
testcase_12 AC 77 ms
15,740 KB
testcase_13 AC 77 ms
15,596 KB
testcase_14 AC 77 ms
15,700 KB
testcase_15 AC 78 ms
15,532 KB
testcase_16 AC 77 ms
15,656 KB
testcase_17 AC 77 ms
15,488 KB
testcase_18 AC 77 ms
15,712 KB
testcase_19 AC 77 ms
15,548 KB
testcase_20 AC 77 ms
15,520 KB
testcase_21 AC 77 ms
15,480 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;

class No29{
    static void Main(){
        var a=Int32.Parse(Console.ReadLine());
        List<string> list=new List<string>();
        for(int i=0;i<a;++i){
            var b=Console.ReadLine().Split(' ');
            list.Add(b[0]);
            list.Add(b[1]);
            list.Add(b[2]);
        }
        list.Sort();
        var c=list.Count;
        var d=0;
        var e=0;
        for(int i=0;i<c-1;++i){
            if(list[i]==list[i+1]){
                d++;
                if(i==c-3)e++;
                i++;
            }else{
                e++;
                if(i==c-2)e++;
            }
        }
        
        Console.WriteLine(d+e/4);
    }
}
0