結果
| 問題 |
No.274 The Wall
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2017-05-25 10:49:32 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,825 bytes |
| コンパイル時間 | 796 ms |
| コンパイル使用メモリ | 109,028 KB |
| 実行使用メモリ | 825,000 KB |
| 最終ジャッジ日時 | 2024-09-19 19:11:24 |
| 合計ジャッジ時間 | 4,085 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 MLE * 1 -- * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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");
}
}
}
No