結果
問題 | No.327 アルファベット列 |
ユーザー |
![]() |
提出日時 | 2015-12-24 23:20:35 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 765 bytes |
コンパイル時間 | 2,582 ms |
コンパイル使用メモリ | 160,640 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 22:10:16 |
合計ジャッジ時間 | 2,537 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#define _USE_MATH_DEFINES#define _CRT_SECURE_NO_WARNINGS#include "bits/stdc++.h"#define rep(i,n) for(int i = 0;i < n;i++)#define REP(i,n,k) for(int i = n;i < k;i++)#define P(p) cout<<(p)<<endl;#define pi 3.1415926535using namespace std;typedef long long ll;typedef unsigned long long ull;int dx[] = { 0, 1, 0, -1 };int dy[] = { -1, 0, 1, 0 };unsigned long long sttoi(std::string str) {unsigned long long ret;std::stringstream ss; ss << str;ss >> ret;return ret;}ll gcd(ll a, ll b){if (b > a)swap(a, b);if (b == 0) return a;return gcd(b, a%b);}void solve() {ll n;cin >> n;string ans = "";while (n >= 0){ans = (char)('A' + (n % 26)) + ans;n /= 26;n--;}cout << ans << endl;}int main() {solve();return 0;}