結果

問題 No.327 アルファベット列
ユーザー itezpace
提出日時 2016-09-07 09:09:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 58,200 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 21:02:33
合計ジャッジ時間 1,987 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin>>n;
  string s;
  int f=0;
  while(1){
    ll a=n%26;
    if(f==1) a-=1;
    a+=65;
    char b=a;
    s+=b;
    n/=26;
    if(n==0) break;
    f=1;
  }
  reverse(s.begin(),s.end());
  cout<<s<<endl;
  return 0;
}
0