結果

問題 No.1827 最長部分スーパーリッチ門松列列
ユーザー maimai
提出日時 2021-09-20 13:43:30
言語 cLay
(20240104-1)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 3,643 ms
コンパイル使用メモリ 161,844 KB
実行使用メモリ 6,616 KB
最終ジャッジ日時 2023-09-29 03:31:44
合計ジャッジ時間 5,534 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 4 ms
4,376 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 11 ms
6,372 KB
testcase_08 AC 11 ms
6,328 KB
testcase_09 AC 11 ms
6,316 KB
testcase_10 AC 11 ms
6,448 KB
testcase_11 AC 11 ms
6,564 KB
testcase_12 AC 11 ms
6,616 KB
testcase_13 AC 11 ms
6,316 KB
testcase_14 AC 11 ms
6,328 KB
testcase_15 AC 11 ms
6,316 KB
testcase_16 AC 11 ms
6,388 KB
testcase_17 AC 15 ms
6,400 KB
testcase_18 AC 16 ms
6,380 KB
testcase_19 AC 11 ms
6,320 KB
testcase_20 AC 11 ms
6,460 KB
testcase_21 AC 11 ms
6,376 KB
testcase_22 AC 11 ms
6,512 KB
testcase_23 AC 11 ms
6,384 KB
testcase_24 AC 12 ms
6,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int imos[500001];

void solve() {
  int N, last_a;
  rd(N);

  fill(imos, imos+N, 0);
  last_a = -1;
  REP(i, N) {
    int a; rd(a);
    if (last_a >= 0) {
      imos[min(a, last_a)] += 1;
      imos[max(a, last_a)] -= 1;
    }
    last_a = a;
  }

  int best = 0, sum = 0;
  REP(i, N)
    best >?= (sum += imos[i]);

  wt(best + 1);
}
{
  int T; rd(T); REP(_, T) solve();
}
0