結果
| 問題 | No.327 アルファベット列 |
| コンテスト | |
| ユーザー |
airuai
|
| 提出日時 | 2016-09-22 14:43:36 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 836 bytes |
| 記録 | |
| コンパイル時間 | 432 ms |
| コンパイル使用メモリ | 79,936 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-12 09:31:18 |
| 合計ジャッジ時間 | 2,014 ms |
|
ジャッジサーバーID (参考情報) |
tmp-judge_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 45 WA * 5 |
ソースコード
#include <iostream>
#include <vector>
#define pr(s) std::cout << s << std::endl
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
long long n;
cin >> n;
vector<char> c;
vector<char>::iterator it = c.begin();
c.insert(it, n % 26 + 'A');
it = c.begin();
n /= 26;
int t;
if (n) {
if ((t = n % 26) == 0) {
c.insert(it, 'Z');
}
else {
c.insert(it, t + 'A' - 1);
}
it = c.begin();
n /= 26;
}
while (n) {
t = n % 26;
if (*(it) == 'Z') {
if (t > 1) {
c.insert(it, t + 'A' - 2);
}
else if (t == 1){
c.insert(it, 'Z');
}
else {
c.insert(it, 'Y');
}
}
else {
if (t == 0) {
c.insert(it, 'Z');
}
else {
c.insert(it, t + 'A' - 1);
}
}
it = c.begin();
n /= 26;
}
while (it != c.end()) {
cout << *it;
++it;
}
cout << endl;
}
airuai