結果
| 問題 |
No.327 アルファベット列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-07 20:45:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 607 bytes |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 60,528 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-08 18:12:35 |
| 合計ジャッジ時間 | 2,377 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 29 WA * 21 |
ソースコード
#include <iostream>
#include <cstdint>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
uint64_t n;
cin >> n;
int ketaCounter = 0;
for (uint64_t i = 0; (uint64_t)pow(26, i) <= n; ++i) {
ketaCounter++;
}
for (int j = ketaCounter - 1; j >= 0; --j) {
if (n >= 26) {
cout << (char)(n / (uint64_t)pow(26, j) + 64);
} else {
cout << (char)(n / (uint64_t)pow(26, j) + 65);
}
n -= (n / (uint64_t)pow(26, j)) * (uint64_t)pow(26, j);
}
cout << endl;
return 0;
}