結果

問題 No.327 アルファベット列
ユーザー rsk0315
提出日時 2019-03-19 23:09:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 65,092 KB
最終ジャッジ日時 2025-01-06 23:35:42
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 47
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%ju", &N);
      |   ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstdint>
#include <vector>
#include <string>
#include <algorithm>

int main() {
  uintmax_t N;
  scanf("%ju", &N);

  std::string res;

  res += 'A' + (N % 26);
  N /= 26;
  while (N) {
    res += 'A' + (N%27 - 1);
    N /= 27;
  }

  std::reverse(res.begin(), res.end());
  printf("%s\n", res.c_str());
}
0