結果
問題 | No.327 アルファベット列 |
ユーザー |
|
提出日時 | 2016-01-22 14:57:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 535 bytes |
コンパイル時間 | 510 ms |
コンパイル使用メモリ | 58,748 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 22:50:15 |
合計ジャッジ時間 | 1,588 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#include <iostream> #include <string> #include <algorithm> const char ABC[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const long long SIZE = (sizeof(ABC) - 1); const char *calc(const long long N, std::string &buff) { long long n = N + 1; do { n -= 1; buff += ABC[n % SIZE]; n /= SIZE; } while (n != 0); std::reverse(buff.begin(), buff.end()); return buff.c_str(); } int main() { long long N; std::string buff; std::cin >> N; std::cout << calc(N, buff) << std::endl; return 0; }