結果

問題 No.711 競技レーティング単調増加
ユーザー te-shte-sh
提出日時 2018-07-03 15:24:55
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 925 ms
コンパイル使用メモリ 95,452 KB
実行使用メモリ 8,008 KB
最終ジャッジ日時 2023-09-03 20:30:18
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 1 ms
4,384 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 1 ms
4,384 KB
testcase_18 AC 25 ms
5,732 KB
testcase_19 AC 25 ms
6,236 KB
testcase_20 AC 26 ms
6,616 KB
testcase_21 AC 28 ms
7,112 KB
testcase_22 AC 25 ms
7,144 KB
testcase_23 AC 29 ms
6,188 KB
testcase_24 AC 29 ms
6,208 KB
testcase_25 AC 24 ms
6,832 KB
testcase_26 AC 26 ms
6,176 KB
testcase_27 AC 25 ms
6,488 KB
testcase_28 AC 15 ms
6,600 KB
testcase_29 AC 16 ms
6,032 KB
testcase_30 AC 32 ms
6,284 KB
testcase_31 AC 37 ms
7,392 KB
testcase_32 AC 40 ms
6,784 KB
testcase_33 AC 36 ms
6,384 KB
testcase_34 AC 34 ms
7,332 KB
testcase_35 AC 38 ms
8,008 KB
testcase_36 AC 10 ms
4,380 KB
testcase_37 AC 35 ms
7,452 KB
testcase_38 AC 26 ms
6,640 KB
testcase_39 AC 11 ms
5,844 KB
testcase_40 AC 18 ms
5,588 KB
testcase_41 AC 1 ms
4,380 KB
testcase_42 AC 18 ms
4,540 KB
testcase_43 AC 24 ms
6,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}

const inf = 10^^9+1;

void main()
{
  int n; readV(n);
  int[] a; readA(n, a);

  foreach (i; 0..n) a[i] -= i;
  auto b = a.filter!"a>0".array;
  auto m = b.length.to!int;

  auto dp = new int[](m);
  dp[] = inf;

  foreach (i; 0..m) {
    auto bs = dp.assumeSorted.lowerBound(b[i]+1);
    dp[bs.length] = b[i];
  }

  writeln(n-dp.assumeSorted.lowerBound(inf).length.to!int);
}
0