結果

問題 No.274 The Wall
ユーザー 14番14番
提出日時 2016-05-11 01:33:05
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 4,013 bytes
コンパイル時間 3,749 ms
コンパイル使用メモリ 104,040 KB
実行使用メモリ 22,880 KB
最終ジャッジ日時 2023-09-12 00:37:05
合計ジャッジ時間 5,468 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 56 ms
20,680 KB
testcase_02 AC 57 ms
20,788 KB
testcase_03 WA -
testcase_04 AC 56 ms
20,832 KB
testcase_05 AC 56 ms
22,872 KB
testcase_06 AC 56 ms
20,696 KB
testcase_07 AC 56 ms
22,844 KB
testcase_08 AC 56 ms
18,736 KB
testcase_09 AC 56 ms
20,756 KB
testcase_10 AC 56 ms
20,808 KB
testcase_11 AC 58 ms
20,856 KB
testcase_12 AC 58 ms
20,804 KB
testcase_13 AC 57 ms
20,696 KB
testcase_14 AC 57 ms
18,688 KB
testcase_15 AC 59 ms
20,764 KB
testcase_16 AC 59 ms
20,860 KB
testcase_17 AC 59 ms
20,760 KB
testcase_18 AC 58 ms
22,740 KB
testcase_19 AC 58 ms
18,756 KB
testcase_20 AC 59 ms
22,880 KB
testcase_21 AC 60 ms
22,748 KB
testcase_22 AC 59 ms
22,788 KB
testcase_23 AC 59 ms
22,840 KB
testcase_24 AC 59 ms
20,860 KB
testcase_25 AC 58 ms
20,864 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.Collections.Generic;
using System.Text;
using System.Linq;

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.GetInt();
        int blockCount = inpt[0];
        int blockLength = inpt[1];
        int[] cnt = new int[blockLength + 1];
        for(int i=0; i<blockCount; i++) {
           inpt = Reader.GetInt();
           cnt[inpt[0]] += 1;
           cnt[inpt[1]+1] -= 1;
        }
        int siki = blockLength / 2;
        if(blockLength % 2 == 1) {
            siki++;
        }
        int[] val = new int[blockLength + 1];
        int currentVal = 0;
        for(int i=0; i<blockLength; i++) {
            currentVal += cnt[i];
            val[i] = currentVal;
        }
        for(int i=siki; i<blockLength; i++) {
            val[blockLength - i - 1] += val[i];
        }
        bool isYes = true;
        for(int i=1; i<blockLength / 2; i++) {
            if(val[i] > 2) {
                isYes = false;
                break;
            }
        }
        if(isYes && blockLength % 2 > 0) {
            if(val[blockLength / 2] > 1) {
                isYes = true;
            }
        }
        Console.WriteLine(isYes?"YES":"NO");
    }

    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"





181 2067
595 608
1963 1982
1791 1796
1897 1902
1552 1556
1934 1940
830 844
457 459
2009 2012
1116 1118
447 455
578 578
241 241
1004 1006
1139 1146
659 666
1027 1036
639 655
196 197
399 419
750 752
388 389
717 731
532 548
1050 1054
570 575
1701 1703
135 137
468 476
383 385
289 290
525 539
735 739
444 447
1948 1953
701 705
611 629
1914 1918
1366 1367
267 271
710 715
1988 1988
1269 1285
1667 1676
1571 1578
563 568
1152 1172
1957 1957
1101 1107
307 308
1395 1397
362 363
1507 1510
262 267
1770 1770
1172 1186
1873 1884
915 919
530 531
1743 1744
858 866
693 695
934 945
1468 1476
400 404
490 504
470 477
1747 1750
1538 1542
929 933
1108 1115
336 338
806 832
6 6
1584 1589
1152 1155
1262 1267
23 26
1075 1087
750 778
1336 1346
1739 1743
2059 2059
1324 1329
68 71
1812 1831
1288 1308
821 829
1543 1547
1920 1926
1161 1170
218 224
552 560
209 216
257 261
846 848
1427 1428
422 432
450 455
1783 1787
1479 1485
1063 1067
1022 1026
1733 1742
1947 1947
870 871
1738 1738
177 190
1006 1011
478 484
76 88
745 749
876 876
1599 1600
551 552
1709 1709
1379 1381
278 288
1632 1640
1511 1513
1892 1902
541 543
366 375
1138 1144
1389 1390
779 793
350 355
1103 1113
1937 1941
1363 1368
561 563
1048 1049
1646 1653
1017 1020
1381 1382
1947 1955
1903 1904
73 75
16 17
384 393
2052 2058
1704 1704
692 694
606 610
1483 1485
1705 1711
1800 1824
1433 1441
863 872
680 683
1753 1759
1600 1600
223 226
284 291
1853 1856
965 1003
1760 1761
2022 2037
60 61
380 382
1943 1945
150 159
353 354
407 409
1443 1452
1402 1406
160 163
1211 1212
2038 2045
1146 1148
45 51
2001 2002
1858 1872
655 657
1416 1424
1922 1924
710 717
1690 1690
1254 1258
843 856
1577 1583





 
";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        public static int[] GetInt(char delimiter = ' ', bool trim = false)
        {
            string inptStr = ReadLine();
            if (trim)
            {
                inptStr = inptStr.Trim();
            }
            string[] inpt = inptStr.Split(delimiter);
            int[] ret = new int[inpt.Length];
            for (int i = 0; i < inpt.Length; i++)
            {
                ret[i] = int.Parse(inpt[i]);
            }
            return ret;
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0