結果

問題 No.2092 Conjugation
ユーザー tnakao0123
提出日時 2022-10-07 23:16:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 527 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 41,284 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-12 21:15:21
合計ジャッジ時間 1,877 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 2092.cc:  No.2092 Conjugation - yukicoder
 */

#include<cstdio>
#include<algorithm>
 
using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

/* global variables */

int as[MAX_N];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", as + i), as[i]--;

  for (int i = 0, j = n - 1; i <= as[0]; i++) {
    while (j >= 0 && as[j] < i) j--;
    printf("%d%c", j + 1, (i < as[0]) ? ' ' : '\n');
  }

  return 0;
}
0