結果

問題 No.327 アルファベット列
ユーザー 👑 CleyL
提出日時 2019-06-21 16:13:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 58,208 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-25 15:11:39
合計ジャッジ時間 2,296 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
    long long n;cin>>n;n++;
    string s;
    //ひとけた目
    while(n != 0){
      s.push_back(((n%26)==0?'Z':'A'+(n%26)-1));
      n = (n-1)/26;
    }
    reverse(s.begin(),s.end());
    cout << s << endl;
}
0