結果

問題 No.327 アルファベット列
ユーザー data9824
提出日時 2015-12-27 23:46:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 58,444 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 22:33:49
合計ジャッジ時間 1,582 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	long long n;
	cin >> n;
	std::string result;
	++n;
	while (n > 0) {
		--n;
		char digit = (char)(n % 26LL);
		result.push_back('A' + digit);
		n /= 26;
	}
	std::reverse(result.begin(), result.end());
	cout << result << endl;
	return 0;
}
0