結果

問題 No.327 アルファベット列
ユーザー springrollspringroll
提出日時 2018-11-19 14:34:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 527 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 169,568 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 15:16:27
合計ジャッジ時間 3,169 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#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