結果

問題 No.327 アルファベット列
ユーザー ha71
提出日時 2020-09-22 15:23:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 1,565 ms
コンパイル使用メモリ 170,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 04:36:51
合計ジャッジ時間 3,173 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include "atcoder/all"
typedef long long int ll;
using namespace std;
// using namespace atcoder;
int main() {
    ll n;
    cin >> n;
    n++;
    vector<int> ans;
    while (n) {
        if (n % 26 == 0) {
            ans.push_back(26);
            n -= 26;
        }
        else {
            ans.push_back(n % 26);
        }
        n /= 26;
    }
    for (int i = ans.size() - 1; i >= 0; i--) {
        printf("%c",'A' - 1 + ans[i]);
    }
    cout << endl;
    return 0;
}
0