結果

問題 No.327 アルファベット列
ユーザー mencotton
提出日時 2020-11-02 21:08:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 70,852 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-22 08:02:53
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 47
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    long long n;
    cin >> n;

    if (n == 0) {
        cout << "A" << endl;
        return 0;
    }

    string ret;
    while (n > 26) {
        ret = string(1, 'A' + n % 26) + ret;
        n /= 26;
    }
    ret = string(1, 'A' + n - 1) + ret;

    cout << ret << endl;
    return 0;
}
0