buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
n = int(input()) s = "abcdefghijklmnopqrstuvwxyz" l = [26] for i in range(2, 14): a = 26 ** (i) + l[i-2] l.append(a) idx = 0 while True: if n <= l[idx]: break idx += 1 if idx == 0: print(s[idx-1]) exit() q = n - l[idx-1] - 1 ll = [] for j in range(idx+1): q, mod = divmod(q, 26) ...
n = int(input()) s = "abcdefghijklmnopqrstuvwxyz" l = [26] for i in range(2, 14): a = 26 ** (i) + l[i-2] l.append(a) idx = 0 while True: if n <= l[idx]: break idx += 1 if idx == 0: print(s[n-1]) exit() q = n - l[idx-1] - 1 ll = [] for j in range(idx+1): q, mod = divmod(q, 26) ...
[["-", 0, 652, 3, 4, 0, 206, 206, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 31, 22]]
5
149
import java.util.Scanner; class Main { static int serialNum; static String[] charList = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; static String output = ""; publ...
import java.util.Scanner; class Main { static int serialNum; static String[] charList = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; static String output = ""; publ...
[["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 499], ["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 25]]
3
234
a=int(input()) s=0 d=1 si=[] while a>0: b=a%26 si.append(b) a=a//26 if b==0: a-=1 c="" for i in si: if i==0: i=26 c+=chr(i+96) c=c[::-1] print(c) print(si)
a=int(input()) s=0 d=1 si=[] while a>0: b=a%26 si.append(b) a=a//26 if b==0: a-=1 c="" for i in si: if i==0: i=26 c+=chr(i+96) c=c[::-1] print(c)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
89
#include <bits/stdc++.h> #define fast \ { \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> #define fast \ { \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 49, 50, 51, 74, 51, 23, 0, 16, 17, 33], ["-", 49, 50, 51, 74, 51, 23, 0, 16, 12, 13]]
1
91
#include <algorithm> #include <iostream> using namespace std; int main() { long long N; string ans; cin >> N; while (true) { long long tmp, mod; tmp = N; mod = tmp % 26; tmp = tmp / 26; ans += char('a' - 1 + mod); N = tmp; if (N == 0) { break; } } reverse(ans.begin(),...
#include <algorithm> #include <iostream> using namespace std; int main() { long long N; string ans; cin >> N; while (true) { long long tmp, mod; tmp = --N; mod = tmp % 26; tmp = tmp / 26; // cout << tmp << mod << endl; ans += char('a' + mod); N = tmp; if (N == 0) { break;...
[["+", 8, 9, 0, 1, 0, 11, 12, 27, 17, 68], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
104
n = int(input()) ans = [] s == 0 while 1: if s == 1 and n < 1: break s = 1 if n%26 == 0: ans.append(0) else: ans.append(n%26) n -= n%26 n = n//26 for i in range(len(ans)): if i != len(ans)-1: if ans[i] <= 0: ans[i+1] -= 1 ans[i] += 26 ...
n = int(input()) ans = [] s = 0 while 1: if s == 1 and n < 1: break s = 1 if n%26 == 0: ans.append(0) else: ans.append(n%26) n -= n%26 n = n//26 for i in range(len(ans)): if i != len(ans)-1: if ans[i] <= 0: ans[i+1] -= 1 ans[i] += 26 ...
[["-", 36, 36, 0, 656, 0, 1, 0, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]]
5
164
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define PI 3.1415926535897932384626 typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vecto...
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define PI 3.1415926535897932384626 typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vecto...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
377
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> typedef long long ll; constexpr long long INFLL = 1e18; using namespace std; int main() { ll n; cin >> n; ll temp = 26; ll count = 0; vec...
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> typedef long long ll; constexpr long long INFLL = 1e18; using namespace std; int main() { ll n; cin >> n; ll temp = 26; ll count = 0; vec...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
216
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define ll long long int #define vecll vector<long long> #define vec2ll vector<vector<long lo...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define ll long long int #define vecll vector<long long> #define vec2ll vector<vector<long lo...
[["-", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["-", 0, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
251
import math alphabets = [chr(i) for i in range(97, 97+26)] N = int(input()) def run(n): a = 0 for i in range(1, 12): if math.pow(26, i) >= n: break n -= int(math.pow(26, i)) ans = '' for j in range(i-1): b = n // int(math.pow(26, i-j-1)) amari = n % int(m...
import math alphabets = [chr(i) for i in range(97, 97+26)] N = int(input()) def run(n): a = 0 for i in range(1, 12): if math.pow(26, i) >= n: break n -= int(math.pow(26, i)) ans = '' for j in range(i-1): b = n // int(math.pow(26, i-j-1)) amari = n % int(ma...
[["-", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 0, 22], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 79], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612]]
5
184
N = int(input()) ans='' while True: n = (N-1)%26 ans = chr(n+64+1) + ans N = N//26 if N == 0: break print(ans.lower())
N = int(input()) ans='' while True: n = (N-1)%26 ans = chr(n+64+1) + ans N = (N-1)//26 if N == 0: break print(ans.lower())
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
55
#include <iostream> #include <vector> using namespace std; vector<int> p; int main() { unsigned long long int a; cin >> a; while (a != 0) { p.push_back(a % 26); a /= 26; } for (int i = p.size() - 1; i >= 0; i--) { char c = p[i] + 96; cout << c; } }
#include <iostream> #include <vector> using namespace std; vector<int> p; int main() { unsigned long long int a; cin >> a; while (a != 0) { a -= 1; p.push_back(a % 26); a /= 26; } for (int i = p.size() - 1; i >= 0; i--) { char c = p[i] + 97; cout << c; } }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
87
#include <bits/stdc++.h> using namespace std; long long n; void print(long long x) { if (x == 0) { return; } print(x / 26); char chr = x % 26 - 1 + 'a'; cout << chr; } int main(void) { cin >> n; print(n); }
#include <bits/stdc++.h> using namespace std; long long n; void print(long long x) { if (x == 0) { return; } --x; print(x / 26); char chr = x % 26 + 'a'; cout << chr; } int main(void) { cin >> n; print(n); }
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 33], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
69
n = int(input()) s = 'abcdefghijklmnopqrstuvwxyz' ans = '' while n > 0: q, r = divmod(n, 26) ans += s[r-1] n = q print(ans[::-1])
n = int(input()) s = 'abcdefghijklmnopqrstuvwxyz' ans = '' while n > 0: n -= 1 q, r = divmod(n, 26) ans += s[r] n = q print(ans[::-1])
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]]
5
53
def main(): n = int(input()) A = list("zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz") beki = [0, 26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286] ika = 0 for i in range(12): if n <= beki[i]: ika = i...
def main(): n = int(input()) A = list("zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz") beki = [0, 26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286] ika = 0 for i in range(12): if n <= beki[i]: ika = i...
[["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
159
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.14159265359 #define INF 1000100100 #define MOD 1000000007 #define all(x) (x).begin(), (x).end() typedef long long ll; #define P pair<int, int> #define PP pair<P, int> #define T tuple<int, int, int> using namespace std; ll powl(ll a, ll...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.14159265359 #define INF 1000100100 #define MOD 1000000007 #define all(x) (x).begin(), (x).end() typedef long long ll; #define P pair<int, int> #define PP pair<P, int> #define T tuple<int, int, int> using namespace std; ll powl(ll a, ll...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
232
N = int(input()) cnt = 1 a = ord("a") while True: if N <= 26**cnt: N -= 1 ans = [] while 0 < N: ans.append(N%26) N //= 26 print("a"*(cnt-len(ans)),end="") for i in range(len(ans)-1,-1,-1): print(chr(a+ans[i]),end="") print() ...
N = int(input()) cnt = 1 a = ord("a") while True: if N <= 26**cnt: N -= 1 ans = [] while 0 < N: ans.append(N%26) N //= 26 print("a"*(cnt-len(ans)),end="") for i in range(len(ans)-1,-1,-1): print(chr(a+ans[i]),end="") print() ...
[["-", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
126
def run(n): ''' ''' _base_array = string.ascii_lowercase results = [] while n > 0: results.append(_base_array[n%26 - 1]) if n%26 == 0: n = n//26 - 1 continue n = n//26 print(''.join(results[::-1])) if __name__ == '__main__': n = int(input()...
import string def run(n): ''' ''' _base_array = string.ascii_lowercase results = [] while n > 0: results.append(_base_array[n%26 - 1]) if n%26 == 0: n = n//26 - 1 continue n = n//26 print(''.join(results[::-1])) if __name__ == '__main__': ...
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
91
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; string a; vector<string> b(15); int m; a = "zabcdefghijklmnopqrstuvwxy"; for (int i = 0; n != 0; i++) { b.at(i) = a.at(n % 26); n = n / 26; m = i; } for (int j = m; j > -1; j--) { cout << b.at(j); } co...
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; string a; vector<string> b(15); int m; a = "zabcdefghijklmnopqrstuvwxy"; for (int i = 0; n != 0; i++) { b.at(i) = a.at(n % 26); n = (n - 1) / 26; m = i; } for (int j = m; j > -1; j--) { cout << b.at(j); ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
111
#include <cmath> #include <iostream> #define ll long long using namespace std; int main() { ll n; cin >> n; ll count = 1, str = 0; while (str + pow(26, count) <= n) { str += pow(26, count); ++count; } while (count >= 1) { ll a = pow(26, count - 1), b = 0; while (str + a <= n) { str ...
#include <cmath> #include <iostream> #define ll long long using namespace std; int main() { ll n; cin >> n; ll count = 1, str = 1; while (str + pow(26, count) <= n) { str += pow(26, count); ++count; } while (count >= 1) { ll a = pow(26, count - 1), b = 0; while (str + a <= n) { str ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 16, 12, 74, 51, 23, 0, 16, 17, 33], ["-", 0, 16, 12, 74, 51, 23, 0, 16, 12, 13]]
1
139
#include <bits/stdc++.h> using namespace std; #define MAX 500000000 // Function to print Excel column name for a given column number void printString(long long int n) { char str[MAX]; // To store result (Excel column name) long long int i = 0; // To store current index in str which is result while (n > ...
#include <bits/stdc++.h> using namespace std; #define MAX 50 // Function to print Excel column name for a given column number void printString(long long int n) { char str[MAX]; // To store result (Excel column name) long long int i = 0; // To store current index in str which is result while (n > 0) { ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
188
n = gets.to_i rsl = [] neko = n while neko > 0 do neko = neko - 1 waruneko = neko % 26 rsl << ('a'.ord + waruneko).chr neko = neko / 26 end puts rsl.join('')
n = gets.to_i rsl = [] neko = n while neko > 0 do neko = neko - 1 waruneko = neko % 26 rsl << ('a'.ord + waruneko).chr neko = neko / 26 end puts rsl.reverse.join('')
[["+", 0, 652, 3, 4, 0, 652, 486, 652, 735, 22], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131]]
4
54
N = int(input()) alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] mm = 1 name = '' while True: if N > 26 ** mm: N = N - 26 ** mm mm += 1 else: break #mmけた print(N) for i in range(mm): if N< 1: ...
N = int(input()) alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] mm = 1 name = '' while True: if N > 26 ** mm: N = N - 26 ** mm mm += 1 else: break #mmけた for i in range(mm): if N< 1: name = ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
217
#include <bits/stdc++.h> using namespace std; #define BIT(n) (1LL << (n)) #define BITF(n, i) (((n) >> (i)) & 1) #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define REPI(i, x) for (int i = 1; i <= x; i++) #define FORI(i, m, n) for (int i = m; i <= n; i++) #define REPR(i...
#include <bits/stdc++.h> using namespace std; #define BIT(n) (1LL << (n)) #define BITF(n, i) (((n) >> (i)) & 1) #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define REPI(i, x) for (int i = 1; i <= x; i++) #define FORI(i, m, n) for (int i = m; i <= n; i++) #define REPR(i...
[["-", 0, 11, 12, 16, 12, 23, 0, 41, 64, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 41, 64, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]]
1
857
// I'm a f*cking looser #include <bits/stdc++.h> using namespace std; #define ll long long #define fasino \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
// I'm a f*cking looser #include <bits/stdc++.h> using namespace std; #define ll long long #define fasino \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
187
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using p = pair<int, int>; int main() { ll n; cin >> n; int num = 1; rep(i, 20) { if ((n - pow(26, i + 1)) >= 1) { n -= pow(26, i + 1); num++; } else break; } const...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using p = pair<int, int>; int main() { ll n; cin >> n; int num = 1; rep(i, 20) { if ((n - pow(26, i + 1)) >= 1) { n -= pow(26, i + 1); num++; } else break; } const...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
203
N=int(input()) abclist=[] for a in 'abcdefghijklmnopqrstuvwxyz': abclist.append(a) k=0 n=N alist=[] while n>0: amari=n%26 if amari==0: n=n//26-1 else: n=n//26 alist.append(amari) print(alist) name='' for a in alist: name=abclist[a-1]+name print(name)
N=int(input()) abclist=[] for a in 'abcdefghijklmnopqrstuvwxyz': abclist.append(a) k=0 n=N alist=[] while n>0: amari=n%26 if amari==0: n=n//26-1 else: n=n//26 alist.append(amari) #print(alist) name='' for a in alist: name=abclist[a-1]+name print(name)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
97
N = int(input()) k = list() while(N >= 27): a = int(N%26) if a==0: a =26 k.insert(0,a) N = (N-a)/26 k.insert(0,int(N)) ans = str() for i in range(len(k)): x = k[i] + 64 +32 ans = ans + str(chr(x)) print(k) print(ans)
N = int(input()) k = list() while(N >= 27): a = int(N%26) if a==0: a =26 k.insert(0,a) N = (N-a)/26 k.insert(0,int(N)) ans = str() for i in range(len(k)): x = k[i] + 64 +32 ans = ans + str(chr(x)) #print(k) print(ans)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
109
def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) n=int(input()) p=num2alpha(n) p=p.lower() p
def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) n=int(input()) p=num2alpha(n) p=p.lower() print(str(p))
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
79
N = int(input()) ans = [] alp = 'abcdefghijklmnopqrstuvwxyz' def dfs(N): n, r = divmod(N, 26) ans.append(alp[r-1]) if N <= 26: return (n, r) return dfs(n) dfs(N) print("".join(ans[::-1]))
N = int(input()) ans = [] alp = 'abcdefghijklmnopqrstuvwxyz' def dfs(N): n, r = divmod(N-1, 26) ans.append(alp[r]) if N <= 26: return (n, r) return dfs(n) dfs(N) print("".join(ans[::-1]))
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
80
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { long long int N; cin >> N; long long int mod = 0; long long int q = 26; string s; while (N > 0) { mod = N % q; if (mod == 0) { s += (char)(122); } else { s += (char)(mod + 96); ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { long long int N; cin >> N; long long int mod = 0; long long int q = 26; string s; while (N > 0) { mod = N % q; if (mod == 0) { s += (char)(122); N -= 26; } else { s += (cha...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
116
n = gets.to_i a = "" i = 1 j = 1 while n > j x = n-j a += ((x/(26**(i-1))) % 26 +97).chr j += 26**i i += 1 end if n == 1 puts "a" else puts a.reverse end
n = gets.to_i a = "" i = 1 j = 1 while n >= j x = n-j a += ((x/(26**(i-1))) % 26 +97).chr j += 26**i i += 1 end if n == 1 puts "a" else puts a.reverse end
[["-", 36, 36, 0, 493, 0, 89, 15, 738, 17, 47], ["+", 36, 36, 0, 493, 0, 89, 15, 738, 17, 20]]
4
70
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define trav(i, a) for (auto &i : (a)) #define sz(x) (int)(x).size() #define all(v) (v).begin(), (v).end() #define fr(i, a, b) for (int i = (a); i <= (b); ++i) void solve(); si...
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define trav(i, a) for (auto &i : (a)) #define sz(x) (int)(x).size() #define all(v) (v).begin(), (v).end() #define fr(i, a, b) for (int i = (a); i <= (b); ++i) void solve(); si...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
223
def resolve(): N = int(input()) N_to_str = "" alphabet_list = "abcdefghijklmnopqrstuvwxyz" while N > 0: N_to_str=alphabet_list[N%26-1]+N_to_str N = (N-N%26)//26 print(N_to_str) if __name__ == "__main__": resolve()
def resolve(): N = int(input()) N_to_str = "" alphabet_list = "zabcdefghijklmnopqrstuvwxyz" # N -= 1 while N > 0: N-=1 N_to_str=alphabet_list[N%26+1]+N_to_str # if N==26: # break N = (N-N%26)//26 print(N_to_str) if __name__ == "__main__": resolve()
[["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["-", 0, 662, 12, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 17, ...
5
64
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define fast \ ios::sync_with_stdio(0); \ cin.tie(0); \ co...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define fast \ ios::sync_with_stdio(0); \ cin.tie(0); \ co...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
130
import string N = int(input()) char_list = string.ascii_lowercase char_list = char_list[:-1] char_list = 'z' + char_list tmp = 0 count = 0 ans = '' while 1: before = tmp count += 1 tmp += 26**count if before < N <= tmp: tmp = N while 1: ans = char_list[tmp%26] + ans ...
import string N = int(input()) char_list = string.ascii_lowercase char_list = char_list[:-1] char_list = 'z' + char_list tmp = 0 count = 0 ans = '' while 1: before = tmp count += 1 tmp += 26**count if before < N <= tmp: tmp = N while 1: ans = char_list[tmp%26] + ans ...
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
99
alp = [chr(i) for i in range(97, 97+26)] N = int(input()) q = N s = "" while True: q,m = divmod(q,26) if m == 0: m = 26 if q == 1: q = 0 s = alp[m - 1] + s if q == 0: break print(s)
alp = [chr(i) for i in range(97, 97+26)] N = int(input()) q = N s = "" while True: q,m = divmod(q,26) if m == 0: m = 26 q -= 1 s = alp[m - 1] + s if q == 0: break print(s)
[["-", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 8, 196, 0, 57, 64, 196, 0, 57, 0, 102], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]...
5
83
N = int(input()) # N = 1000000000000001 alphabet = [chr(ord('a') + i) for i in range(26)] resid = [] while(True): q, mod = divmod(N, 26) resid.append(mod) if(q == 0): break N = q # print(resid) for i in range(len(resid)): e = resid.pop() print(alphabet[e-1], end = "") print(""...
N = int(input()) # N = 1000000000000001 alphabet = [chr(ord('a') + i) for i in range(26)] resid = [] while(True): q, mod = divmod(N - 1, 26) resid.append(mod) if(q == 0): break N = q # print(resid) for i in range(len(resid)): e = resid.pop() print(alphabet[e], end = "") print(...
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
105
def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) num2alpha(int(input())).lower()
def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) print(num2alpha(int(input())).lower())
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
70
N = int(input()) def num10to26(num): if num<=26: return chr(64+num) elif num%26==0: return num10to26(num//26-1)+chr(90) else: return num10to26(num//26)+chr(64+num%26) print(num10to26(N))
N = int(input()) def num10to26(num): if num<=26: return chr(64+num) elif num%26==0: return num10to26(num//26-1)+chr(90) else: return num10to26(num//26)+chr(64+num%26) print(str.lower(num10to26(N)))
[["+", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
72
#include <bits/stdc++.h> using namespace std; // long long using ll = long long; // pair<int, int> using PII = pair<int, int>; //最大値、mod const int MOD = 1000000007; const int mod = 1000000007; const int INF = 1000000000; const long long LINF = 1e18; const int MAX = 510000; //出力系 #define print(x) cout << x << endl #...
#include <bits/stdc++.h> using namespace std; // long long using ll = long long; // pair<int, int> using PII = pair<int, int>; //最大値、mod const int MOD = 1000000007; const int mod = 1000000007; const int INF = 1000000000; const long long LINF = 1e18; const int MAX = 510000; //出力系 #define print(x) cout << x << endl #...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,918
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; ++i) #define FOR(i, b, n) for (ll i = b; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; void solve(ll N) { N--; const char table[] = "abcdefghijklmnopqstuvwxyz"; string name; while (N >= 26) { // printf("N=...
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; ++i) #define FOR(i, b, n) for (ll i = b; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; void solve(ll N) { N--; const char table[] = "abcdefghijklmnopqrstuvwxyz"; string name; while (N >= 26) { // printf("N...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6]]
1
154
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FILL0(x) memset(x, 0, sizeof(x)) using namespace std; typedef long long ll; typedef pair<ll, ll> P; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> boo...
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FILL0(x) memset(x, 0, sizeof(x)) using namespace std; typedef long long ll; typedef pair<ll, ll> P; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> boo...
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
245
n = int(input()) alpha = [chr(x) for x in range(ord('a'), ord('z')+1)] name = '' while n: r = int(n%26) n = n // 26 name += alpha[r-1] print(name[::-1])
n = int(input()) alpha = [chr(x) for x in range(ord('a'), ord('z')+1)] name = '' while n: n -= 1 r = int(n%26) n = n // 26 name += alpha[r] print(name[::-1])
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]]
5
75
#include <bits/stdc++.h> using namespace std; #define w cout #define e '\n' #define int long long #define sz(x) (int)x.size() #define re return #define vi vector<int> #define vii vector<pair<int, int>> #define F first #define S second #define pussy push_back template <class T> inline istream &operator>>(istream &str,...
#include <bits/stdc++.h> using namespace std; #define w cout #define e '\n' #define int long long #define sz(x) (int)x.size() #define re return #define vi vector<int> #define vii vector<pair<int, int>> #define F first #define S second #define pussy push_back template <class T> inline istream &operator>>(istream &str,...
[["+", 8, 9, 0, 57, 64, 1, 0, 34, 0, 21], ["+", 0, 57, 64, 1, 0, 34, 12, 27, 28, 22], ["+", 0, 57, 64, 1, 0, 34, 12, 27, 17, 68]]
1
190
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define fi first #define se second #define INF 1000000009 #define LLINF 1000000000000000009LL ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define fi first #define se second #define INF 1000000009 #define LLINF 1000000000000000009LL ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 3, 4, 0, 74, 51, 23, 0, 16, 17, 33], ["-", 3, 4, 0, 74, 51, 23, 0, 16, 12, 13]]
1
130
n = gets.to_i map = {} ('a'..'y').to_a.each_with_index do |alp, i| map[i + 1] = alp end map[0] = 'z' ans = '' loop do ans = map[n % 26] + ans n -= 1 if n % 26 == 0 n /= 26 break if n == 0 end
n = gets.to_i map = {} ('a'..'y').to_a.each_with_index do |alp, i| map[i + 1] = alp end map[0] = 'z' ans = '' loop do ans = map[n % 26] + ans n -= 1 if n % 26 == 0 n /= 26 break if n == 0 end puts ans
[["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]]
4
79
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; template <class T> class Input { public: auto operator()() const...
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; template <class T> class Input { public: auto operator()() const...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
1,270
#include <bits/stdc++.h> // One implementation to rule them all? #define db double #define ll long long int #define ld long long double //#define int long long int #define ull unsigned long long #define fi first #define se second #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, n, b) for (int ...
#include <bits/stdc++.h> // One implementation to rule them all? #define db double #define ll long long int #define ld long long double //#define int long long int #define ull unsigned long long #define fi first #define se second #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, n, b) for (int ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["-", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 78]]
1
748
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #define deb(x) cerr << #x << ": " << x << '\n'; #define ios \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #define deb(x) cerr << #x << ": " << x << '\n'; #define ios \ ios_base::sync_with_stdio(false); ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
124
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; typedef unsigned int uint; typedef unsigned long int lu; typedef unsigned long long llu; typedef long int ld; typedef long long lld; typedef vector<int> vint; typedef vector<unsigned int> vuint; typedef vector<unsigned long int> vlu; typedef vector<u...
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; typedef unsigned int uint; typedef unsigned long int lu; typedef unsigned long long llu; typedef long int ld; typedef long long lld; typedef vector<int> vint; typedef vector<unsigned int> vuint; typedef vector<unsigned long int> vlu; typedef vector<u...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25]]
1
184
#include <algorithm> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; #define rep(i, a, n) fo...
#include <algorithm> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; #define rep(i, a, n) fo...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
621
#include "bits/stdc++.h" using namespace std; #define ll long long #define pll pair<ll, ll> #define vll vector<ll> #define rep(x, l, r) for (x = l; x < r; x++) const ll mod = 1000000007; void solve() { ll i, j, k, l, m, n, x, y, u, v, r, p, a, b, aa, bb; cin >> n; string ans = ""; while (n) { k = n % 26;...
#include "bits/stdc++.h" using namespace std; #define ll long long #define pll pair<ll, ll> #define vll vector<ll> #define rep(x, l, r) for (x = l; x < r; x++) const ll mod = 1000000007; void solve() { ll i, j, k, l, m, n, x, y, u, v, r, p, a, b, aa, bb; cin >> n; string ans = ""; while (n > 0) { k = n %...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68]]
1
189
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define rep(i, a, b, c) for (ll i = (a); i <= (b); i += (c)) #define repb(i, a, b, c) for (ll i = (a); i >= (b); i -= (c)) #define MOD 1000000007 #define inf 3e18 #define ld long double #define mp make_pair #define vpll vector<pair<...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define rep(i, a, b, c) for (ll i = (a); i <= (b); i += (c)) #define repb(i, a, b, c) for (ll i = (a); i >= (b); i -= (c)) #define MOD 1000000007 #define inf 3e18 #define ld long double #define mp make_pair #define vpll vector<pair<...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
662
#include <algorithm> #include <array> #include <bitset> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68]]
1
1,567
alphabets = [*'a'..'z'] N = gets.to_i answer = [] num = N while num > 0 do answer.push(alphabets[(num - 1) % 26]) num = (num - 1) / 26 p num end puts answer.reverse.join
alphabets = [*'a'..'z'] N = gets.to_i answer = [] num = N while num > 0 do answer.push(alphabets[(num - 1) % 26]) num = (num - 1) / 26 end puts answer.reverse.join
[["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["-", 0, 89, 8, 170, 0, 652, 3, 4, 0, 22]]
4
62
N = int(input()) char = [i for i in range(97, 97+26)] a_n = 96 base = 26 base_list = [] ans = '' while N > 0: add = N % 26 if add==0: add=26 ans += chr(a_n+add) N = N // 26 # # base_list += [base] # # base = base + base*26 # base = 26 # # cumsum = 0 # for b in enumerate(base_list): # ...
N = int(input()) char = [i for i in range(97, 97+26)] a_n = 96 base = 26 base_list = [] ans = '' while N > 0: add = N % 26 if add==0: add=26 ans += chr(a_n+add) N = (N-1) // 26 # # base_list += [base] # # base = base + base*26 # base = 26 # # cumsum = 0 # for b in enumerate(base_list):...
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
91
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <new> #include <queue> #include <random> #include <set> #include <sstrea...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <new> #include <queue> #include <random> #include <set> #include <sstrea...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
278
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int MOD = 1e9 + 7; using ll = long long; using Graph = vector<vector<int>>; int main() { ll n; cin >> n; n--; vector<int> ans; while (n > 26) { int res = 0; res = n % 26; n /= 26; ans.push...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int MOD = 1e9 + 7; using ll = long long; using Graph = vector<vector<int>>; int main() { ll n; cin >> n; n--; vector<int> ans; while (n > 25) { int res = 0; res = n % 26; n /= 26; ans.push...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
136
import sys #sys.exit() #sorted( ,reverse=True) N = int(input()) #S,T = map(int, input().split()) #A = list(map(int, input().split())) #A = [int(input()) for _ in range(N)] #cnt = 0 #cnt += 1 d="" dchar ="abcdefghijklmnopqrstuvwxyz" while N > 0: d += dchar[N%26-1] N//=26 print(d[::-1]) #print(N) #prin...
import sys #sys.exit() #sorted( ,reverse=True) N = int(input()) #S,T = map(int, input().split()) #A = list(map(int, input().split())) #A = [int(input()) for _ in range(N)] #cnt = 0 #cnt += 1 d="" dchar ="abcdefghijklmnopqrstuvwxyz" while N > 0: N -= 1 d += dchar[N%26] N//=26 #print(N%26,N,d) prin...
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]]
5
60
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long n = Long.parseLong(scan.next()); scan.close(); StringBuilder sb = new StringBuilder(); while (n > 0) { long l = n % 26; if (l == 0) { sb.appen...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long n = Long.parseLong(scan.next()); scan.close(); StringBuilder sb = new StringBuilder(); while (n > 0) { long l = n % 26; if (l == 0) { sb.appen...
[["+", 0, 57, 64, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 110], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35]]
3
135
// C++ program to find Excel // column name from a given // column number #include <bits/stdc++.h> #define MAX 50 using namespace std; // Function to print Excel column name for a given column number void printString(long long int n) { char str[MAX]; // To store result (Excel column name) long long int i = 0...
// C++ program to find Excel // column name from a given // column number #include <bits/stdc++.h> #define MAX 50 using namespace std; // Function to print Excel column name for a given column number void printString(long long int n) { char str[MAX]; // To store result (Excel column name) long long int i = 0...
[["-", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["-", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
171
n = input() def num2alpha(num): if num<=26: return chr(96+num) elif num%26==0: return num2alpha(num//26-1)+chr(122) else: return num2alpha(num//26)+chr(96+num%26) print(num2alpha(n))
n = int(input()) def num2alpha(num): if num <= 26: return chr(96 + num) elif num % 26 == 0: return num2alpha(num // 26 - 1) + chr(122) else: return num2alpha(num // 26) + chr(96 + num % 26) print(num2alpha(n))
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
69
def ans(an, n, N, X, x, inx): N -= inx * x ** (n + 1) if n == 0: an += X[N] return an an += X[N // x**n] inx = N // x**n n -= 1 return ans(an, n, N, X, x, inx) N = int(input()) X = "abcdefghijklnmopqrstuvwxyz" an = "" x = 26 n = 1 inx = 0 while N > x * ((x**n - 1)//(x - 1)): n += 1 n -= 1 N -= ...
def ans(an, n, N, X, x, inx): N -= inx * x ** (n + 1) if n == 0: an += X[N] return an an += X[N // x**n] inx = N // x**n n -= 1 return ans(an, n, N, X, x, inx) N = int(input()) X = "abcdefghijklmnopqrstuvwxyz" an = "" x = 26 n = 1 inx = 0 while N > x * ((x**n - 1)//(x - 1)): n += 1 n -= 1 N -= ...
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
166
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; static inline int kBASE = 26; int main() { // vector<int> X(5); // int x1, x2, x3, x4, x5; long long N; cin >> N; vector<long long> rank(11); rank[0] = 0; rank[1] = 1; ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; static const int kBASE = 26; int main() { // vector<int> X(5); // int x1, x2, x3, x4, x5; long long N; cin >> N; vector<long long> rank(13); rank[0] = 0; rank[1] = 1; ...
[["-", 36, 36, 0, 30, 0, 43, 0, 114, 0, 174], ["+", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
283
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; typedef long long ll; const int N = 110; char res[N]; int g; int main() { ll n; scanf("%lld", &n); while (n) { res[g++] = (n - 1) % 26 + 'a'; n /= 26; } for (int i = g - 1; i >= 0; i--) printf("%c", res[i]); puts(""...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; typedef long long ll; const int N = 110; char res[N]; int g; int main() { ll n; scanf("%lld", &n); while (n) { res[g++] = (n - 1) % 26 + 'a'; n--; n /= 26; } for (int i = g - 1; i >= 0; i--) printf("%c", res[i]); ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
114
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 11)] N = int(input()) for b in reversed(bounds): if b <= N: break N -= b length = bounds.index(b) + 1 s = '' for i in range(length - 1, 0, -1): idx, N = divmod(N, 26**i) s = s + lis[idx] print(s + lis[N])
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 12)] lis = 'abcdefghijklmnopqrstuvwxyz' N = int(input()) for b in reversed(bounds): if b <= N: break N -= b length = bounds.index(b) + 1 s = '' for i in range(length - 1, 0, -1): idx, N = divmod(N, 26**i) s = s + lis[idx] print(s + lis[N]...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 654], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 655]]
5
111
n=int(input()) #96 a="" while n>0: n-=1 rem=n%26 a+=chr(97+rem) n=(n-rem)//26 print(a)
n=int(input()) #96 a="" while n>0: n-=1 rem=n%26 a+=chr(97+rem) n=(n-rem)//26 print(a[::-1])
[["+", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["+", 3, 4, 0, 206, 206, 663, 0, 664, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 664, 28, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73]]
5
47
entierAConvertir = int(input()) baseArrivee= 26 sortie = [] while entierAConvertir>0: reste = entierAConvertir % baseArrivee if reste==0: reste = 26 sortie.append(reste) entierAConvertir-=reste entierAConvertir = (entierAConvertir//baseArrivee) print(sortie) for i in range(len(sortie)): print(chr(sorti...
entierAConvertir = int(input()) baseArrivee= 26 sortie = [] while entierAConvertir>0: reste = entierAConvertir % baseArrivee if reste==0: reste = 26 sortie.append(reste) entierAConvertir-=reste entierAConvertir = (entierAConvertir//baseArrivee) for i in range(len(sortie)): print(chr(sortie[len(sortie)-...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
95
n = int(input()) def NumToAlpha(n): if n<=26: return chr(64+n) elif n%26==0: return NumToAlpha(n//26-1)+chr(90) else: return NumToAlpha(n//26)+chr(64+n%26) N = NumToAlpha(n) print(N)
n = int(input()) def NumToAlpha(n): if n<=26: return chr(96+n) elif n%26==0: return NumToAlpha(n//26-1)+chr(122) else: return NumToAlpha(n//26)+chr(96+n%26) N = NumToAlpha(n) print(N)
[["-", 0, 37, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 37, 0, 652, 3, 4, 0, 657, 31, 612], ["-", 0, 37, 0, 657, 12, 652, 3, 4, 0, 612], ["+", 0, 37, 0, 657, 12, 652, 3, 4, 0, 612], ["-", 0, 657, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 31, 612]]
5
75
a=[26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286] n=int(input()) k=0 for i in range(10): if n<=a[i]: k=i+1 break else: k=11 if k==1: print(chr(n+96)) else: ans="" n=n-a[k-2] for i in range(k): if i!...
a=[26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286] n=int(input()) k=0 for i in range(10): if n<=a[i]: k=i+1 break else: k=11 if k==1: print(chr(n+96)) else: ans="" n=n-a[k-2]-1 for i in range(k): if ...
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
159
n = int(input()) nam = "" flag = True while(flag): k = n % 26 if n <= 26: flag = False if k == 0: k = 26 nam = chr(96 + k) + nam n = n // 26 print(nam)
n = int(input()) nam = "" flag = True while(flag): k = n % 26 if n <= 26: flag = False if k == 0: k = 26 nam = chr(96 + k) + nam n = (n - k) // 26 print(nam)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
60
n = int(input()) dicts = {} dicts[1] = "a" dicts[2] = "b" dicts[3] = "c" dicts[4] = "d" dicts[5] = "e" dicts[6] = "f" dicts[7] = "g" dicts[8] = "h" dicts[9] = "i" dicts[10] = "j" dicts[11] = "k" dicts[12] = "l" dicts[13] = "m" dicts[14] = "n" dicts[15] = "o" dicts[16] = "p" dicts[17] = "q" dicts[18] = "r" dicts[19] = ...
n = int(input()) dicts = {} dicts[1] = "a" dicts[2] = "b" dicts[3] = "c" dicts[4] = "d" dicts[5] = "e" dicts[6] = "f" dicts[7] = "g" dicts[8] = "h" dicts[9] = "i" dicts[10] = "j" dicts[11] = "k" dicts[12] = "l" dicts[13] = "m" dicts[14] = "n" dicts[15] = "o" dicts[16] = "p" dicts[17] = "q" dicts[18] = "r" dicts[19] = ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
286
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, i, b, c, d; char s; string t; s = 'a'; cin >> a; i = 1; while (a > 0) { if ((a % 26 == 0) && (a > 0)) { t += "z"; a -= 26; } else { t = char(s + a % 26 - 1) + t; a -= a % 26; } a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, i, b, c, d; char s; string t; s = 'a'; cin >> a; i = 1; while (a > 0) { if ((a % 26 == 0) && (a > 0)) { t = "z" + t; a -= 26; } else { t = char(s + a % 26 - 1) + t; a -= a % 26; } ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
118
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> //マクロ #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REPS(i, n) for (int i = 1; i <= (int)(n); ++i)...
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> //マクロ #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REPS(i, n) for (int i = 1; i <= (int)(n); ++i)...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
340
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define fastInp \ cin.tie(0); ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define fastInp \ cin.tie(0); ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
105
#include <bits/stdc++.h> using namespace std; #define pi 2 * asin(1.0) int main() { long N; cin >> N; vector<long> r(20); vector<long> A(20); int R; r.at(0) = 26; for (int i = 1; i < 20; i++) { r.at(i) = (r.at(i - 1) + 1) * 26; } for (int i = 0; i < 20; i++) { if (r.at(i) >= N) { R ...
#include <bits/stdc++.h> using namespace std; #define pi 2 * asin(1.0) int main() { long N; cin >> N; vector<long> r(20); vector<long> A(20); int R; r.at(0) = 26; for (int i = 1; i < 20; i++) { r.at(i) = (r.at(i - 1) + 1) * 26; } for (int i = 0; i < 20; i++) { if (r.at(i) >= N) { R ...
[["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
242
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; const int INF = 100000000; const int MAX_N = 100; typedef pair<int, int> P; typedef long long ll; int main() { ll N, count; count = 0; cin >> N; string s = "zabcdefghijklmnopqrstuvwxy"; string ans = ""; if (N < 27...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; const int INF = 100000000; const int MAX_N = 100; typedef pair<int, int> P; typedef long long ll; int main() { ll N, count; count = 0; cin >> N; string s = "zabcdefghijklmnopqrstuvwxy"; string ans = ""; if (N < 27...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
173
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; void ABC171C() { ll N; cin >> N; string x; while (N >= 1) { int d = N % 26; --d; if (d < 0) d += ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; void ABC171C() { ll N; cin >> N; string x; while (N >= 1) { int d = N % 26; --d; if (d < 0) d += ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
145
#!/usr/bin/env ruby n = gets.chomp.to_i s = '' loop do s = s + (n % 26 + 'a'.ord - 1).chr.to_s n = n / 26 break if n == 0 end puts s.reverse
#!/usr/bin/env ruby n = gets.chomp.to_i s = '' loop do n -= 1 s = s + (n % 26 + 'a'.ord).chr.to_s n = n / 26 break if n == 0 end puts s.reverse
[["+", 0, 652, 196, 737, 8, 736, 0, 755, 31, 22], ["+", 0, 652, 196, 737, 8, 736, 0, 755, 17, 110], ["+", 0, 652, 196, 737, 8, 736, 0, 755, 12, 612], ["-", 12, 652, 486, 652, 486, 739, 0, 738, 17, 33], ["-", 12, 652, 486, 652, 486, 739, 0, 738, 12, 612]]
4
50
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll powk(ll a, ll n = 2) { ll r = 1; for (ll i = 0; i < n; i++) { r *= a; } return r; } int main() { ll n; cin >> n; string ans; ll t = 26; while (n >= 1) { ll x = n % t; if (x == 0) { x = 26; n /= 26; ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll powk(ll a, ll n = 2) { ll r = 1; for (ll i = 0; i < n; i++) { r *= a; } return r; } int main() { ll n; cin >> n; string ans; ll t = 26; while (n >= 1) { ll x = n % t; if (x == 0) { x = 26; n -= 26; ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110]]
1
149
#include <bits/stdc++.h> #define ll long long int #define M 1000000007 using namespace std; ll n, t; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; string s = "", s1 = "zabcdefghijklmnopqrstuvwxy"; while (n) { s += s1[n % 26]; if (n % 26 == 0 && n == 26) break; n /=...
#include <bits/stdc++.h> #define ll long long int #define M 1000000007 using namespace std; ll n, t; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; string s = "", s1 = "zabcdefghijklmnopqrstuvwxy"; while (n) { s += s1[n % 26]; if (n % 26 == 0) n--; n /= 26; } re...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 57, 64, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 17, 68]]
1
105
#include <iostream> using namespace std; int ans[20]; int tot = 0; int main() { ios::sync_with_stdio(false); long long n; cin >> n; while (n) { int temp = n % 26; if (temp == 0) { temp = 26; n /= 26; } ans[tot++] = temp; n /= 26; } for (int i = tot - 1; i >= 0; i--) { int...
#include <iostream> using namespace std; int ans[20]; int tot = 0; int main() { ios::sync_with_stdio(false); long long n; cin >> n; while (n) { int temp = n % 26; if (temp == 0) { temp = 26; n -= 26; } ans[tot++] = temp; n /= 26; } for (int i = tot - 1; i >= 0; i--) { int...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110]]
1
123
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { long long N; cin >> N; int r = (N - 1) / 26; int b = (N - 1) % 26; string S; S = (char)('a' + b); while (r > 0) { b = (r - 1) % 26; r = (r - 1) / 26; S = S + (char)('a' + b); } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { long long N; cin >> N; long int r = (N - 1) / 26; long int b = (N - 1) % 26; string S; S = (char)('a' + b); while (r > 0) { b = (r - 1) % 26; r = (r - 1) / 26; S = (char)('a' + b) +...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
118
n = int(input()) def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) x = num2alpha(n) print(x)
n = int(input()) def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return num2alpha(num//26-1)+chr(90) else: return num2alpha(num//26)+chr(64+num%26) X = num2alpha(n) print(X.swapcase())
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+",...
5
75
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) int main() { long long N; cin >> N; string ans; while (N > 0) { ans += '`' + N % 26; N /= 26; } rever...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) int main() { long long N; cin >> N; string ans; while (N > 0) { --N; ans += 'a' + N % 26; N /= 26; ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 1, 0, 11, 12, 16, 31, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 16, 31, 103, 0, 125]]
1
91
N = int(input()) n = 26 m = 1 while N > n: n = n + n * 26 m += 1 e = n result = '' for i in range(m): a = N % 26 if a == 0: a = 26 result = chr(a + 96) + result N = (N - a) // 26 print(result)
N = int(input()) n = 26 m = 1 while N > n: n = n * 26 + 26 m += 1 e = n result = '' for i in range(m): a = N % 26 if a == 0: a = 26 result = chr(a + 96) + result N = (N - a) // 26 print(result)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 1, 0, 662, 12, 657, 12, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
80
n = int(input()) alp = [chr(i) for i in range(97, 97+26)] ans = [] while n != 0 and n != 1: c = n % 26 ans.insert(0, alp[c-1]) n //= 26 if c == 0: n -= 1 print("".join(ans))
n = int(input()) alp = [chr(i) for i in range(97, 97+26)] ans = [] while n != 0: c = n % 26 ans.insert(0, alp[c-1]) n //= 26 if c == 0: n -= 1 print("".join(ans))
[["-", 36, 36, 0, 656, 0, 52, 15, 679, 17, 355], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 0, 22], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 667, 79], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 0, 612]]
5
79
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <set> #include <vector> using namespace std; void name(long long n) { char last = (n - 1) % 26 + 'a'; n /= 26; if (n) name(n); printf("%c", last); } int main() { long long N; scanf("%lld", &N); name(N); return 0; ...
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <set> #include <vector> using namespace std; void name(long long n) { char last = --n % 26 + 'a'; n /= 26; if (n) name(n); printf("%c", last); } int main() { long long N; scanf("%lld", &N); name(N); return 0; }
[["-", 49, 50, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 16, 31, 27, 17, 68], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 49, 50, 51, 16, 31, 16, 31, 23, 0, 25]]
1
90
n = int(input()) alphabet = list("abcdefghijklmnopqrstuvwxyz") if n <= 26: print(alphabet[n-1]) else: ans = "" while(True): q, mod = divmod(n, 26) if mod == 0: q -= 1 ans = "z" + ans else: ans = alphabet[mod-1] + ans if q <= 1: ...
n = int(input()) alphabet = list("abcdefghijklmnopqrstuvwxyz") if n <= 26: print(alphabet[n-1]) else: ans = "" while(True): q, mod = divmod(n, 26) if mod == 0: q -= 1 ans = "z" + ans else: ans = alphabet[mod-1] + ans if q < 1: b...
[["-", 0, 52, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 667, 18]]
5
91
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; #define dump(x) cerr << #x << "=" << x << endl using P = pair<int, int>; int main() { ll n; cin >> n; vector<char> alpha; alpha.push_back('z'); for (char i = 'a'; i <= 'z'; i++) { alpha.push_...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; #define dump(x) cerr << #x << "=" << x << endl using P = pair<int, int>; int main() { ll n; cin >> n; vector<char> alpha; alpha.push_back('z'); for (char i = 'a'; i <= 'z'; i++) { alpha.push_...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
223
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int INF = 1001001001; using P = pair<int, int>; const char a[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int INF = 1001001001; using P = pair<int, int>; const char a[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', ...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
286
//#pragma GCC optimize "trapv" #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define S 1000001 #define M 1000000007 #define nl cout << "\n"; #define er cout << "\n***********\n"; #define fast ...
//#pragma GCC optimize "trapv" #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define S 1000001 #define M 1000000007 #define nl cout << "\n"; #define er cout << "\n***********\n"; #define fast ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
237
N = int(input()) D = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] a = 26 b = 1 while True: if N // (a + 1) == 0: break b += 1 a += 26 ** b A = [0] * b for i in range(b): N -= 26 ** i for i in range(b - 1, ...
N = int(input()) D = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] a = 26 b = 1 while True: if N // (a + 1) == 0: break b += 1 a += 26 ** b A = [0] * b for i in range(b): N -= 26 ** i for i in range(b - 1, ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
239
N = int(input()) ls = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','z','v','w','x','y'] word = '' while N != 0: word = ls[N%26] + word N = (N-1) // 26 print(word)
N = int(input()) ls = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y'] word = '' while N != 0: word = ls[N%26] + word N = (N-1) // 26 print(word)
[["-", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6]]
5
147
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
448
#include <stdio.h> void ans(long n); int main() { long n; scanf("%ld", &n); ans(n); printf("\n"); } void ans(long n) { long m = n % 26; char c; if (m == 0) { c = 'z'; } else { c = 'a' + m - 1; } if (n <= 26) { printf("%c", c); } else { ans(n / 26); printf("%c", c); } }
#include <stdio.h> void ans(long n); int main() { long n; scanf("%ld", &n); ans(n); printf("\n"); } void ans(long n) { long m = n % 26; char c; if (m == 0) { c = 'z'; } else { c = 'a' + m - 1; } if (n <= 26) { printf("%c", c); } else { ans((n - 1) / 26); printf("%c", c); }...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25]]
0
121
n = gets.to_i s = "" a = ['z'] + ('a'..'z').to_a while n > 0 x = n % 26 n = n / 26 s += a[x] n -= 1 if x == 0 end puts s
n = gets.to_i s = "" a = ['z'] + ('a'..'z').to_a while n > 0 x = n % 26 n = n / 26 s += a[x] n -= 1 if x == 0 end puts s.reverse
[["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
58
alpha = 'abcdefghijklmnopqrstuvwxyz' N= int(input()) len_alpha = 26 tmp = N calc = tmp cnt = 1 while tmp > 0: calc = tmp tmp -= (len_alpha **cnt) cnt += 1 res ='' for i in range(1, cnt - 1): tmp = int(calc/(len_alpha**(cnt - i - 1))) calc -= tmp * len_alpha**(cnt - i - 1) res += alpha[tmp] re...
alpha = 'abcdefghijklmnopqrstuvwxyz' N= int(input()) len_alpha = 26 tmp = N calc = tmp cnt = 1 while tmp > 0: calc = tmp tmp -= (len_alpha **cnt) cnt += 1 res ='' for i in range(1, cnt - 1): tmp = int((calc-1)/(len_alpha**(cnt - i - 1))) calc -= tmp * len_alpha**(cnt - i - 1) res += alpha[tmp]...
[["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
108
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typedef pair<int, Pii> P1; #define rep(i, n) for (int i = 0; i < n; i++) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typedef pair<int, Pii> P1; #define rep(i, n) for (int i = 0; i < n; i++) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, ...
[["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
234