結果

問題 No.327 アルファベット列
ユーザー mdj982
提出日時 2015-12-30 16:33:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 855 ms
コンパイル使用メモリ 91,156 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 08:46:26
合計ジャッジ時間 1,939 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 47
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <random>
//#include "toollib.h"
#define INT_MAX 2147483647
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#pragma warning (disable:4018)

using namespace std;
typedef long long int lint;

//***** Main Program *****
int main() {
	lint N;
	cin >> N;
	lint _N = N;
	int l = 0;
	do {
		l++;
		_N -= (lint)pow(26, l);
	} while (_N >= 0);
	_N = N;
	for (int i = 1; i < l; i++) _N -= (lint)pow(26, i);
	string s;
	Loop(i, l) s += 'A';
	int b;
	Loop(i, l) {
		b = _N % 26;
		_N /= 26;
		s[i] += b;
	}
	cout << s << endl;
	return 0;
}
0