結果

問題 No.29 パワーアップ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-28 12:03:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 718 bytes
コンパイル時間 2,335 ms
コンパイル使用メモリ 102,584 KB
実行使用メモリ 23,696 KB
最終ジャッジ日時 2023-09-19 06:05:47
合計ジャッジ時間 5,137 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
23,668 KB
testcase_01 AC 81 ms
19,624 KB
testcase_02 AC 82 ms
19,564 KB
testcase_03 AC 82 ms
21,564 KB
testcase_04 AC 83 ms
23,460 KB
testcase_05 AC 83 ms
21,516 KB
testcase_06 AC 81 ms
19,468 KB
testcase_07 AC 81 ms
23,524 KB
testcase_08 AC 82 ms
23,576 KB
testcase_09 AC 81 ms
21,532 KB
testcase_10 AC 82 ms
21,456 KB
testcase_11 AC 82 ms
23,548 KB
testcase_12 AC 81 ms
19,560 KB
testcase_13 AC 81 ms
23,628 KB
testcase_14 AC 82 ms
21,400 KB
testcase_15 AC 81 ms
21,512 KB
testcase_16 AC 82 ms
21,600 KB
testcase_17 AC 81 ms
21,364 KB
testcase_18 AC 82 ms
23,536 KB
testcase_19 AC 82 ms
23,696 KB
testcase_20 AC 82 ms
19,660 KB
testcase_21 AC 82 ms
21,628 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