結果
問題 |
No.274 The Wall
|
ユーザー |
![]() |
提出日時 | 2017-05-25 12:10:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 2,103 bytes |
コンパイル時間 | 733 ms |
コンパイル使用メモリ | 111,736 KB |
実行使用メモリ | 824,908 KB |
最終ジャッジ日時 | 2024-09-19 19:11:42 |
合計ジャッジ時間 | 3,463 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; int L2 = m - 1 - R; int R2 = m - 1 - L; if (L == L2 && R == R2) { } else { for (int s = L2; s <= R2; 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"); } } }