結果

問題 No.327 アルファベット列
コンテスト
ユーザー springroll
提出日時 2018-11-19 14:34:49
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 257µs
コード長 527 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 815 ms
コンパイル使用メモリ 186,412 KB
実行使用メモリ 9,896 KB
最終ジャッジ日時 2026-10-07 08:39:54
合計ジャッジ時間 3,091 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

string AtoZ;

int main() {
    ll N;
    cin >> N;
    list<char> lst;
    for(char ch='A'; ch<='Z'; ch++){
        AtoZ.push_back(ch);
    }
    ll cnt=0, mod=26;
    while(1){
        ll x;
        x = N%mod;
        lst.push_front(AtoZ[x]);
        N /= mod;
        N--;
        
        //cout << N <<" "<< x << endl;

        if(N==-1) break;
    }

    for(auto itr=lst.begin(); itr!=lst.end(); itr++){
        cout << *itr;
    }
    cout << endl;
}
0