結果

問題 No.327 アルファベット列
ユーザー rsk0315
提出日時 2019-03-19 23:18:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 64,876 KB
最終ジャッジ日時 2025-01-06 23:35:45
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

  do {
    res += 'A' + (N % 26);
    N /= 26;
  } while (N-- != 0);

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