結果

問題 No.274 The Wall
ユーザー NoNo
提出日時 2017-05-25 10:49:32
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 1,825 bytes
コンパイル時間 888 ms
コンパイル使用メモリ 109,596 KB
実行使用メモリ 823,828 KB
最終ジャッジ日時 2023-10-19 23:15:22
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,196 KB
testcase_01 AC 26 ms
24,196 KB
testcase_02 AC 26 ms
24,200 KB
testcase_03 AC 27 ms
24,196 KB
testcase_04 AC 26 ms
24,196 KB
testcase_05 AC 26 ms
24,200 KB
testcase_06 AC 26 ms
24,196 KB
testcase_07 AC 26 ms
24,196 KB
testcase_08 AC 26 ms
24,200 KB
testcase_09 AC 27 ms
24,200 KB
testcase_10 AC 26 ms
24,196 KB
testcase_11 AC 28 ms
24,196 KB
testcase_12 MLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace Yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int m = int.Parse(ss[1]);
            var li = new List<bool[]>();
            bool[] a = new bool[m];
            li.Add(a);

            for (int i = 0; i < n; i++)
            {
                var li2 = new List<bool[]>();
                ss = Console.ReadLine().Split();
                int L = int.Parse(ss[0]);
                int R = int.Parse(ss[1]);

                foreach (var item in li)
                {
                    bool[] item2 = (bool[])item.Clone();
                    bool f = true;
                    for (int s = L; s <= R; s++)
                    {
                        if (item2[s])
                        {
                            f = false;
                            break;
                        }
                        else
                        {
                            item2[s] = true;
                        }
                    }
                    if (f)li2.Add(item2);

                    f = true;
                    for (int s = m - 1 - R; s <= m - 1 - L; s++)
                    {
                        if (item[s])
                        {
                            f = false;
                            break;
                        }
                        else
                        {
                            item[s] = true;
                        }
                    }
                    if (f)li2.Add(item);
                }

                li = li2;
            }
            if (li.Count == 0) Console.WriteLine("NO");
            else Console.WriteLine("YES");
        }
    }
}
0