結果

問題 No.3132 暗号メッセージ
ユーザー sai
提出日時 2025-05-02 21:23:31
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 3,343 ms
コンパイル使用メモリ 279,544 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-05-02 21:23:37
合計ジャッジ時間 4,017 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  std::cin >> n;
  std::vector<int> D(n);
  for (int i = 0; i < n; i++) {
    std::cin >> D[i];
  }
  std::vector<int> B(n);
  for (int i = 0; i < n; i++) {
    B[i] = D[i] / 26;
  }
  std::vector<int> P(n);
  std::iota(P.begin(), P.end(), 0);
  std::sort(P.begin(), P.end(), [&](int i, int j) -> bool {
    return B[i] < B[j];
  });
  for (auto i : P) {
    std::cout << (char)('A' + D[i] % 26);
  }
  std::cout << '\n';
}
0