結果

問題 No.1557 Binary Variable
ユーザー 👑 kakel-sankakel-san
提出日時 2021-06-25 21:44:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 371 ms / 2,000 ms
コード長 697 bytes
コンパイル時間 2,545 ms
コンパイル使用メモリ 65,500 KB
実行使用メモリ 39,024 KB
最終ジャッジ日時 2023-09-07 14:24:47
合計ジャッジ時間 16,154 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
36,876 KB
testcase_01 AC 314 ms
35,040 KB
testcase_02 AC 64 ms
23,812 KB
testcase_03 AC 64 ms
23,920 KB
testcase_04 AC 301 ms
32,536 KB
testcase_05 AC 304 ms
38,876 KB
testcase_06 AC 298 ms
36,664 KB
testcase_07 AC 300 ms
34,668 KB
testcase_08 AC 312 ms
36,712 KB
testcase_09 AC 318 ms
34,628 KB
testcase_10 AC 333 ms
36,396 KB
testcase_11 AC 329 ms
37,068 KB
testcase_12 AC 309 ms
36,632 KB
testcase_13 AC 334 ms
37,040 KB
testcase_14 AC 338 ms
36,596 KB
testcase_15 AC 327 ms
35,060 KB
testcase_16 AC 351 ms
32,616 KB
testcase_17 AC 339 ms
36,656 KB
testcase_18 AC 342 ms
36,856 KB
testcase_19 AC 354 ms
37,024 KB
testcase_20 AC 354 ms
33,004 KB
testcase_21 AC 355 ms
37,032 KB
testcase_22 AC 355 ms
38,976 KB
testcase_23 AC 355 ms
37,004 KB
testcase_24 AC 356 ms
35,144 KB
testcase_25 AC 359 ms
34,976 KB
testcase_26 AC 361 ms
39,024 KB
testcase_27 AC 362 ms
36,844 KB
testcase_28 AC 362 ms
34,904 KB
testcase_29 AC 370 ms
38,680 KB
testcase_30 AC 371 ms
34,800 KB
testcase_31 AC 368 ms
34,580 KB
testcase_32 AC 370 ms
36,840 KB
testcase_33 AC 357 ms
36,952 KB
testcase_34 AC 64 ms
23,824 KB
testcase_35 AC 65 ms
23,892 KB
testcase_36 AC 65 ms
21,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using static System.Console;
using System.Linq;

class yuki301
{
    static int[] NList => Console.ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NMap(int n) => Enumerable.Repeat<int>(0, n).Select(_ => NList).ToArray();
    static void Main()
    {
        var c = NList;
        var (n, m) = (c[0], c[1]);
        var map = NMap(m);

        Array.Sort(map, (a, b) => a[1].CompareTo(b[1]));
        var pos = 0;
        var res = 0;
        while (pos < m)
        {
            ++res;
            var right = map[pos][1];
            while (pos < m && map[pos][0] <= right) ++pos;
        }
        WriteLine(n - res);
    }
}
0