結果

問題 No.3848 Max Under Cyclic Shifts
コンテスト
ユーザー tnakao0123
提出日時 2026-12-05 20:29:46
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 643 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 199 ms
コンパイル使用メモリ 57,712 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-12-05 20:29:53
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* -*- coding: utf-8 -*-
 *
 * 3848.cc:  No.3848 Max Under Cyclic Shifts - yukicoder
 */

#include<cstdio>
#include<algorithm>

using namespace std;

/* constant */

const int MAX_N = 200000;
const int MAX_K = 10;

/* typedef */

/* global variables */

int mnds[MAX_K];

/* subroutines */

/* main */

int main() {
  int n, k;
  scanf("%d%d", &n, &k);

  fill(mnds, mnds + k, 10);
  for (int i = 0; i < n; i++) {
    int ai;
    scanf("%d", &ai);
    for (int j = 0; j < k; j++, ai /= 10)
      mnds[j] = min(mnds[j], ai % 10);
  }

  int x = 0;
  for (int j = k - 1; j >= 0; j--) x = x * 10 + mnds[j];

  printf("%d\n", x);
  
  return 0;
}
0