結果

問題 No.110 しましまピラミッド
ユーザー しらゆきしらゆき
提出日時 2015-12-27 18:14:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 5,000 ms
コード長 1,065 bytes
コンパイル時間 2,897 ms
コンパイル使用メモリ 106,628 KB
実行使用メモリ 23,704 KB
最終ジャッジ日時 2023-08-30 03:50:27
合計ジャッジ時間 5,410 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
21,580 KB
testcase_01 AC 62 ms
21,636 KB
testcase_02 AC 62 ms
19,584 KB
testcase_03 AC 62 ms
21,728 KB
testcase_04 AC 62 ms
23,644 KB
testcase_05 AC 62 ms
23,684 KB
testcase_06 AC 64 ms
21,552 KB
testcase_07 AC 62 ms
21,540 KB
testcase_08 AC 63 ms
23,704 KB
testcase_09 AC 62 ms
21,792 KB
testcase_10 AC 62 ms
19,680 KB
testcase_11 AC 65 ms
21,804 KB
testcase_12 AC 63 ms
23,676 KB
testcase_13 AC 62 ms
19,708 KB
testcase_14 AC 64 ms
23,608 KB
testcase_15 AC 62 ms
21,620 KB
testcase_16 AC 64 ms
21,740 KB
testcase_17 AC 63 ms
21,620 KB
testcase_18 AC 62 ms
21,752 KB
testcase_19 AC 62 ms
21,692 KB
testcase_20 AC 62 ms
21,544 KB
testcase_21 AC 62 ms
21,800 KB
testcase_22 AC 63 ms
21,636 KB
testcase_23 AC 62 ms
21,692 KB
testcase_24 AC 62 ms
21,644 KB
testcase_25 AC 62 ms
21,616 KB
testcase_26 AC 62 ms
21,636 KB
testcase_27 AC 64 ms
23,576 KB
testcase_28 AC 63 ms
21,672 KB
testcase_29 AC 62 ms
21,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;
using System.Linq;

class Program
{
    static void Main()
    {
        int nw = int.Parse(Console.ReadLine());
        var w = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int nb = int.Parse(Console.ReadLine());
        var b = Console.ReadLine().Split().Select(int.Parse).ToArray();

        int wh = 1;
        int bh = 1;

        bool f = true;

        for (int i = w.Min() + 1; i <= 20; i++)
        {
            if (f && b.Contains(i))
            {
                wh++;
                f = false;
            }
            else if (!f && w.Contains(i))
            {
                wh++;
                f = true;
            }
        }

        f = true;

        for (int i = b.Min() + 1; i <= 20; i++)
        {
            if (!f && b.Contains(i))
            {
                bh++;
                f = true;
            }
            else if (f && w.Contains(i))
            {
                bh++;
                f = false;
            }
        }
        
        Console.WriteLine(Math.Max(wh, bh));
    }
}
0