結果

問題 No.1827 最長部分スーパーリッチ門松列列
コンテスト
ユーザー mai
提出日時 2021-09-20 13:43:30
言語 cLay
(20250308-1 + boost 1.90.0)
コンパイル:
clayc _filename_
実行:
./a.out
結果
AC  
実行時間 9 ms / 2,000 ms
+ 667µs
コード長 374 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,584 ms
コンパイル使用メモリ 190,412 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2026-08-22 14:19:27
合計ジャッジ時間 8,551 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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