結果

問題 No.29 パワーアップ
ユーザー water_is_Iwater_is_I
提出日時 2017-09-24 03:43:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 1,212 bytes
コンパイル時間 2,012 ms
コンパイル使用メモリ 98,532 KB
実行使用メモリ 22,884 KB
最終ジャッジ日時 2023-08-09 00:45:35
合計ジャッジ時間 4,346 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,884 KB
testcase_01 AC 57 ms
20,620 KB
testcase_02 AC 57 ms
22,792 KB
testcase_03 AC 57 ms
20,708 KB
testcase_04 AC 57 ms
22,828 KB
testcase_05 AC 57 ms
22,740 KB
testcase_06 AC 57 ms
20,756 KB
testcase_07 AC 57 ms
20,636 KB
testcase_08 AC 56 ms
20,628 KB
testcase_09 AC 56 ms
20,784 KB
testcase_10 AC 56 ms
20,688 KB
testcase_11 AC 56 ms
22,720 KB
testcase_12 AC 57 ms
22,800 KB
testcase_13 AC 56 ms
20,628 KB
testcase_14 AC 57 ms
22,720 KB
testcase_15 AC 56 ms
20,744 KB
testcase_16 AC 57 ms
22,676 KB
testcase_17 AC 58 ms
20,632 KB
testcase_18 AC 58 ms
20,692 KB
testcase_19 AC 57 ms
20,704 KB
testcase_20 AC 58 ms
22,820 KB
testcase_21 AC 58 ms
18,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace YukiCorderNo29_20170924 {
    class Program {
        static void Main(string[] args) {
            string N;
            N = Console.ReadLine();

            int[] itemBox = new int[Int32.Parse(N) * 3];

            for (int i = 1; i <= Int32.Parse(N); i++) {
                string[] inputItem = Console.ReadLine().Split(' ');
                for (int j = 0; j < 3; j++) {
                    itemBox[(i - 1) * 3 + j] = Int32.Parse(inputItem[j]);
                    //Console.WriteLine((i - 1) * 3 + j + ": " + itemBox[(i - 1) * 3 + j]);
                }
            }

            int powerUp = 0;
            int num = 0;
            int amariNum = 0;

            for (int i = 1; i <= 10; i++) {
                num = 0;
                for (int j = 0; j < itemBox.Length; j++) {
                    if (itemBox[j] == i) {
                        num++;
                        //Console.WriteLine("numAdd:"+ i);
                    }
                    //Console.WriteLine(num);
                }
                powerUp += num / 2;
                amariNum += num % 2;
            }
            powerUp += amariNum / 4;
            Console.WriteLine(powerUp);
        }
    }
}
0