結果

問題 No.327 アルファベット列
ユーザー stone_725
提出日時 2017-10-07 12:00:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 1,543 ms
コンパイル使用メモリ 158,932 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 04:24:27
合計ジャッジ時間 3,062 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

using namespace std;

static void solve()
{
  long long num;
  cin >> num;
  string ans;
  while (true) {
    ans = static_cast<char>(num % 26 + 'A') + ans;
    if (num < 26) break;
    num /= 26;
    num--;
  }
  cout << ans << "\n";
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie();
  solve();
}
0