結果

問題 No.110 しましまピラミッド
ユーザー しらゆきしらゆき
提出日時 2015-12-27 18:10:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,065 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 106,376 KB
実行使用メモリ 25,416 KB
最終ジャッジ日時 2023-10-19 11:18:31
合計ジャッジ時間 4,249 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
25,340 KB
testcase_01 AC 30 ms
25,340 KB
testcase_02 AC 29 ms
25,340 KB
testcase_03 AC 30 ms
25,340 KB
testcase_04 AC 30 ms
25,340 KB
testcase_05 AC 30 ms
25,344 KB
testcase_06 AC 30 ms
25,340 KB
testcase_07 AC 30 ms
25,340 KB
testcase_08 WA -
testcase_09 AC 31 ms
25,352 KB
testcase_10 AC 30 ms
25,352 KB
testcase_11 AC 30 ms
25,352 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 30 ms
25,340 KB
testcase_19 WA -
testcase_20 AC 30 ms
25,340 KB
testcase_21 AC 30 ms
25,340 KB
testcase_22 AC 30 ms
25,340 KB
testcase_23 WA -
testcase_24 AC 30 ms
25,352 KB
testcase_25 AC 30 ms
25,340 KB
testcase_26 AC 29 ms
25,340 KB
testcase_27 AC 29 ms
25,352 KB
testcase_28 WA -
testcase_29 AC 30 ms
25,352 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 = false;
            }
            else if (f && w.Contains(i))
            {
                bh++;
                f = true;
            }
        }
        
        Console.WriteLine(Math.Max(wh, bh));
    }
}
0