結果

問題 No.327 アルファベット列
ユーザー 情報学生
提出日時 2019-09-25 01:22:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 778 bytes
コンパイル時間 1,594 ms
コンパイル使用メモリ 173,744 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-19 14:55:58
合計ジャッジ時間 2,780 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
const std::vector<std::string> alphabet = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
std::vector<std::string> d;
void solve(long long n) {
    while (n >= 26) {
        d.push_back(alphabet[n%26]);
        n = (n / 26) - 1;
    }
    d.push_back(alphabet[n%26]);
} 

void No327() {
    using namespace std;
    long long N; cin >> N;
    solve(N);
    int n = static_cast<int>(d.size());
    for (int i = n - 1; n > 0; n--) {
        cout << d[i];
    }
    cout << endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    std::cerr << std::fixed << std::setprecision(10);
    No327();
    return 0;
}
0