結果
問題 |
No.327 アルファベット列
|
ユーザー |
![]() |
提出日時 | 2015-12-20 00:36:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 1,125 ms |
コンパイル使用メモリ | 161,032 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-17 11:09:56 |
合計ジャッジ時間 | 2,347 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 37 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define FOR(i,n,m) for (int i=n; i<(int)(m); i++) #define INF 1000000007 #define mp make_pair typedef long long ll; typedef long double ld; ll dy[4]={-1,1,0,0}; ll dx[4]={0,0,1,-1}; /*---------- template ----------*/ ll N; int main(){ cin >> N; ll t=1; ll s=0; int leng=0; FOR(i,1,10){ t*=26; s+=t; if(s-1 > N){ s-=t; N-=s; leng=i; break; } } string ans=""; while(N!=0){ int t=N%26; ans=char('A'+t)+ans; N/=26; } REP(i,leng-ans.size()){ ans=ans+'A'; } cout << ans << endl; return 0; }