結果

問題 No.327 アルファベット列
ユーザー Hank
提出日時 2016-06-28 19:48:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 61,408 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-11 22:39:43
合計ジャッジ時間 1,813 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 6 WA * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

//first one :A-Z:0-25
//the other :A-Z:1-26
int main(){
  long int n;
  int m;
  bool flag = true;
  string ans = "";
  vector<int> q;
  
  cin >> n;
  
  do{
    if(flag){
      m=n%26;
      n=n/26;
      flag = !flag;
    }
    else{
      m=n%27;
      n=n/27;
    }
    ans = char('A'+m)+ans;
    
  }while(n>26);
  ans = char('A'+n-1)+ans;
  cout << ans << endl;
}
0