結果

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

ソースコード

diff #

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

using namespace std;

int main() {
    long long n;
    cin >> n;
    if (n < 26) {
        cout << (char) ('A' + n) << endl;
        return 0;
    }

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

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