結果

問題 No.29 パワーアップ
ユーザー funakoshifunakoshi
提出日時 2019-06-20 17:37:47
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,504 bytes
コンパイル時間 2,874 ms
コンパイル使用メモリ 103,008 KB
実行使用メモリ 22,916 KB
最終ジャッジ日時 2023-08-22 20:27:37
合計ジャッジ時間 5,424 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,532 KB
testcase_01 AC 57 ms
20,712 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 57 ms
20,640 KB
testcase_08 WA -
testcase_09 AC 57 ms
20,560 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 58 ms
20,592 KB
testcase_14 WA -
testcase_15 AC 57 ms
22,656 KB
testcase_16 AC 59 ms
20,632 KB
testcase_17 WA -
testcase_18 AC 57 ms
20,668 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 57 ms
20,636 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;

namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string n = Console.ReadLine();
            int[] itemcnt = new int[10];
            int defeattime = int.Parse(n);
            int pupcnt = 0;
            for(int i=0;i<itemcnt.Length;i++)
            {
                itemcnt[i] = 0;
            }
            for(int i=0;i<defeattime;i++)
            {
                string item = Console.ReadLine();
                string[] itemary = item.Split(' ');
                int a = int.Parse(itemary[0]);
                int b = int.Parse(itemary[1]);
                int c = int.Parse(itemary[2]);
                itemcnt[a - 1] = itemcnt[a - 1]+1;
                itemcnt[b - 1] = itemcnt[b - 1]+1;
                itemcnt[c - 1] = itemcnt[c - 1]+1;
                
            }
            int cnt = 0;
            for (int i=0;i<itemcnt.Length;i++)
            {
                while (itemcnt[i] >= 2)
                {
                    itemcnt[i] = itemcnt[i] - 2;
                    pupcnt++;
                }
                if (itemcnt[i] == 1)
                {
                    itemcnt[i]--;
                    cnt++;
                }
                if (cnt == 4)
                {
                    pupcnt++;
                }
            }

            Console.WriteLine(pupcnt);
        }
    }
}
0