結果

問題 No.711 競技レーティング単調増加
ユーザー ei1333333ei1333333
提出日時 2018-06-29 23:01:20
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 200,684 KB
実行使用メモリ 14,496 KB
最終ジャッジ日時 2023-09-13 15:33:24
合計ジャッジ時間 8,026 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
10,992 KB
testcase_01 AC 61 ms
10,972 KB
testcase_02 AC 60 ms
10,980 KB
testcase_03 AC 61 ms
11,120 KB
testcase_04 AC 61 ms
11,080 KB
testcase_05 AC 61 ms
11,124 KB
testcase_06 AC 61 ms
10,992 KB
testcase_07 AC 60 ms
10,820 KB
testcase_08 AC 61 ms
11,080 KB
testcase_09 AC 61 ms
10,952 KB
testcase_10 AC 61 ms
11,100 KB
testcase_11 AC 61 ms
10,788 KB
testcase_12 AC 61 ms
11,208 KB
testcase_13 AC 61 ms
10,992 KB
testcase_14 AC 61 ms
11,160 KB
testcase_15 AC 61 ms
10,864 KB
testcase_16 AC 61 ms
11,216 KB
testcase_17 AC 61 ms
11,024 KB
testcase_18 AC 118 ms
12,564 KB
testcase_19 AC 116 ms
12,884 KB
testcase_20 AC 120 ms
13,668 KB
testcase_21 AC 123 ms
13,144 KB
testcase_22 AC 117 ms
13,924 KB
testcase_23 AC 125 ms
12,776 KB
testcase_24 AC 124 ms
12,808 KB
testcase_25 AC 114 ms
12,632 KB
testcase_26 AC 119 ms
13,300 KB
testcase_27 AC 114 ms
12,744 KB
testcase_28 AC 111 ms
12,808 KB
testcase_29 AC 119 ms
13,964 KB
testcase_30 AC 122 ms
13,612 KB
testcase_31 AC 136 ms
13,384 KB
testcase_32 AC 140 ms
13,028 KB
testcase_33 AC 133 ms
13,396 KB
testcase_34 AC 128 ms
13,296 KB
testcase_35 AC 135 ms
12,936 KB
testcase_36 AC 94 ms
14,496 KB
testcase_37 AC 143 ms
12,688 KB
testcase_38 AC 118 ms
12,820 KB
testcase_39 AC 90 ms
12,032 KB
testcase_40 AC 100 ms
12,276 KB
testcase_41 AC 60 ms
10,876 KB
testcase_42 AC 94 ms
12,168 KB
testcase_43 AC 108 ms
12,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

const int INF = 1 << 30;

int main() {
  int N;
  vector< int > vs;
  cin >> N;
  for(int i = -1000000; i <= 0; i++) {
    vs.push_back(i);
  }
  for(int i = 0; i < N; i++) {
    int x;
    cin >> x;
    vs.push_back(x);
  }
  vector< int > lis(vs.size(), INF);
  for(int i = 0; i < vs.size(); i++) {
    vs[i] -= i;
    *upper_bound(begin(lis), end(lis), vs[i]) = vs[i];
  }
  int sz = lower_bound(begin(lis), end(lis), INF) - begin(lis);
  cout << vs.size() - sz << endl;
}
0