結果

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

ソースコード

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]);
    for (int i = static_cast<int>(d.size()); i > 0; i--) {
        std::cout << d[i-1];
    }
} 

void No327() {
    using namespace std;
    long long N; cin >> N;
    solve(N);
    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