結果

問題 No.365 ジェンガソート
ユーザー mencottonmencotton
提出日時 2018-02-19 23:12:37
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 960 bytes
コンパイル時間 2,218 ms
コンパイル使用メモリ 107,176 KB
実行使用メモリ 31,888 KB
最終ジャッジ日時 2023-09-23 03:39:44
合計ジャッジ時間 8,162 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,580 KB
testcase_01 AC 61 ms
21,560 KB
testcase_02 AC 61 ms
21,616 KB
testcase_03 AC 62 ms
19,504 KB
testcase_04 AC 62 ms
23,556 KB
testcase_05 AC 61 ms
19,520 KB
testcase_06 AC 62 ms
21,588 KB
testcase_07 AC 62 ms
23,620 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 61 ms
23,648 KB
testcase_15 AC 62 ms
23,492 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 72 ms
22,140 KB
testcase_19 AC 107 ms
27,812 KB
testcase_20 AC 81 ms
22,592 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 111 ms
30,176 KB
testcase_37 AC 104 ms
28,196 KB
testcase_38 WA -
testcase_39 AC 109 ms
28,184 KB
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

namespace _365
{
    class Program
    {
        public static int LowerBound(int[] arr,int value)
        {
            int low = 0;
            int high = arr.Length;
            int mid;
            while (low < high)
            {
                mid = ((high - low) / 2) + low;
                if (arr[mid] < value)
                    low = mid + 1;
                else
                    high = mid;
            }
            return low;
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] dp = new int[n];
            for (int i = 0; i < n; i++) dp[i] = 1000000000;
            for (int i = 0; i < n; i++)
            {
                dp[LowerBound(dp,x[i])] = x[i];
            }
            Console.WriteLine(n - LowerBound(dp,1000000000));
        }
    }
}
0