結果

問題 No.29 パワーアップ
ユーザー しらゆきしらゆき
提出日時 2015-11-19 13:17:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 101,688 KB
実行使用メモリ 22,708 KB
最終ジャッジ日時 2023-10-11 18:04:03
合計ジャッジ時間 4,533 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,740 KB
testcase_01 AC 59 ms
22,676 KB
testcase_02 AC 59 ms
20,588 KB
testcase_03 AC 59 ms
20,764 KB
testcase_04 AC 59 ms
20,672 KB
testcase_05 AC 59 ms
20,676 KB
testcase_06 AC 59 ms
20,576 KB
testcase_07 AC 59 ms
20,704 KB
testcase_08 AC 59 ms
20,708 KB
testcase_09 AC 59 ms
22,640 KB
testcase_10 AC 60 ms
20,820 KB
testcase_11 AC 60 ms
22,636 KB
testcase_12 AC 59 ms
20,500 KB
testcase_13 AC 59 ms
20,704 KB
testcase_14 AC 60 ms
20,676 KB
testcase_15 AC 60 ms
20,740 KB
testcase_16 AC 60 ms
22,708 KB
testcase_17 AC 59 ms
22,628 KB
testcase_18 AC 59 ms
20,684 KB
testcase_19 AC 60 ms
20,740 KB
testcase_20 AC 59 ms
20,516 KB
testcase_21 AC 59 ms
20,596 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());

        string s = "";
        int up = 0;

        for(int i=0;i< n; i++)
        {
            string[] str = Console.ReadLine().Split();
            for(int j = 0; j < 3; j++)
            {
                if (str[j] == "10") str[j] = "0";
            }
            s += str[0] + str[1] + str[2];
        }

        for(int i = 0; i <= 9; i++)
        {
            int t = s.Length - s.Replace(i.ToString(), "").Length;
            if (t > 1) up += t / 2;
        }

        up += (s.Length - up * 2) / 4;

        Console.WriteLine(up);
    }
}
0