結果
| 問題 | No.327 アルファベット列 |
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-12-21 21:14:38 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 694 bytes |
| 記録 | |
| コンパイル時間 | 1,151 ms |
| コンパイル使用メモリ | 189,884 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 09:04:40 |
| 合計ジャッジ時間 | 3,224 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 42 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
LL N;cin>>N;
string _s;
while(N>=26*27){
_s+=('A'+(N%26));
N/=26;
if(N<26*27&&N>=0){
N--;
}
}
vector<string> unko;
string s="AA";
for(s[0]='A';s[0]<='Z';s[0]++)
for(s[1]='A';s[1]<='Z';s[1]++)unko.push_back(s);
s="A";
for(s[0]='A';s[0]<='Z';s[0]++)unko.push_back(s);
sort(unko.begin(),unko.end(),
[](const string& x,const string& y){
if(x.size()==y.size())return x<y;
else return x.size()<y.size();
});
reverse(_s.begin(),_s.end());
if(N>=0)_s=unko[N]+_s;
cout<<_s<<endl;
return 0;
}
btk