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
x = gets.to_i alf = [] ans = [] for i in "a".."z" alf.push(i) end loop { x = x - 1 shou = x / 26 amari = x % 26 ans.push(alf[amari]) x = shou if x == 0 break end } p ans.reverse.join
x = gets.to_i alf = [] ans = [] for i in "a".."z" alf.push(i) end loop { x = x - 1 shou = x / 26 amari = x % 26 ans.push(alf[amari]) x = shou if x == 0 break end } puts ans.reverse.join
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
72
#include <bits/stdc++.h> using namespace std; typedef long long int ll; void solve() { ll n; cin >> n; // n--; vector<ll> v; while (n != 0) { v.push_back((n - 1) % 26); n /= 26; } for (int i = v.size() - 1; i >= 0; i--) { cout << (char)('a' + v[i]); } } int main() { ll t = 1; // cin>>t...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; void solve() { ll n; cin >> n; vector<ll> v; while (n != 0) { n--; v.push_back((n) % 26); n /= 26; } for (int i = v.size() - 1; i >= 0; i--) { cout << (char)('a' + v[i]); } } int main() { ll t = 1; // cin>>t; w...
[["+", 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, 16, 31, 23, 0, 16, 17, 33], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
118
import string def frac(digit,n): ans[digit]=n%26 if n <= 26: return else: return frac(digit+1,n//26) n = int(input()) l=0 r=0 for i in range(1,10000000000000): l = r+1 r = l+26**i-1 if l <= n <= r: n = n-l+1 break n=n-1 ans=[0]*i frac(0,n) res="" for i in ans[::-1]: res+=string.ascii_lo...
import string def frac(digit,n): ans[digit]=n%26 if n < 26: return else: frac(digit+1,n//26) return n = int(input()) l=0 r=0 for i in range(1,10000000000000000000000): l = r+1 r = l+26**i-1 if l <= n <= r: n = n-l+1 break n=n-1 ans=[0]*i frac(0,n) res="" for i in ans[::-1]: res+=str...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 18], ["-", 0, 57, 75, 76, 8, 196, 0, 37, 0, 38], ["+", 0, 57, 75, 76, 8, 196, 0, 37, 0, 38], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
135
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; string s = ""; while (n > 0) { n = n - 1; char c; int i = 'A' + (n % 26); // cout<<i<<" "; if (i == 90) c = 'Z'; else c = i; s += c; n = n / 26; } reverse(s.begin(), s.end()); ...
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; string s = ""; while (n > 0) { n = n - 1; char c; int i = 'a' + (n % 26); // cout<<i<<" "; if (i == 122) c = 'z'; else c = i; s += c; n = n / 26; } reverse(s.begin(), s.end()...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 43, 49, 50, 51, 16, 31, 103, 0, 125], ["+", 0, 43, 49, 50, 51, 16, 31, 103, 0, 125], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125]]
1
103
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string s; while (n > 0) { s += n % 26 + 0x60; n /= 26; } reverse(s.begin(), s.end()); cout << s << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string s; while (n > 0) { n--; s += n % 26 + 0x61; n /= 26; } reverse(s.begin(), s.end()); cout << s << endl; return 0; }
[["+", 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, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
71
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(k, i, n) for (ll i = k; i < n; ++i) #define pb push_back int main(void) { ll n; cin >> n; ll c = 0, tmp = 1, z = 26; while (tmp < n) { n -= tmp; ++c; tmp *= z; } // cout<<c<<endl; string line = "abcdefghijklmnopqrs...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(k, i, n) for (ll i = k; i < n; ++i) #define pb push_back int main(void) { ll n; cin >> n; ll c = 0, tmp = 1, z = 26; while (tmp <= n) { n -= tmp; ++c; tmp *= z; } // cout<<c<<endl; string line = "abcdefghijklmnopqr...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
130
from string import ascii_lowercase N = int(input()) s = list() while N > 0: m = N%26 - 1 s.append(ascii_lowercase[m]) N = int(N/26) s.reverse() s = ''.join(s) print(s)
from string import ascii_lowercase N = int(input()) s = list() while N > 0: N -= 1 m = N%26 s.append(ascii_lowercase[m]) N = int(N/26) s.reverse() s = ''.join(s) print(s)
[["+", 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], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
64
#include <bits/stdc++.h> #define ll long long #define M 1000000007 using namespace std; // Solve function here // End Solve function int main() { // ios::sync_with_stdio(0); // cin.tie(0); // ifstream cin1("input.in"); // clock_t start, finish; char temp = 'a' - 1; long long n; cin >> n; string res...
#include <bits/stdc++.h> #define ll long long #define M 1000000007 using namespace std; // Solve function here // End Solve function int main() { // ios::sync_with_stdio(0); // cin.tie(0); // ifstream cin1("input.in"); // clock_t start, finish; char temp = 'a' - 1; long long n; cin >> n; string res...
[["+", 0, 52, 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, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
1
114
import sys INF = 1 << 60 MOD = 10**9 + 7 # 998244353 sys.setrecursionlimit(2147483647) input = lambda:sys.stdin.readline().rstrip() def resolve(): n = int(input()) res = [] while n: n, r = divmod(n, 26) # print(r) res.append(chr(ord('a') + r - 1)) res.reverse() print(''.join...
import sys INF = 1 << 60 MOD = 10**9 + 7 # 998244353 sys.setrecursionlimit(2147483647) input = lambda:sys.stdin.readline().rstrip() def resolve(): n = int(input()) res = [] while n: n, r = divmod(n - 1, 26) res.append(chr(ord('a') + r)) res.reverse() print(''.join(res)) resolve()
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
104
n = input() ans = [] while n: n, r = divmod(n - 1, 26) ans.append(chr(ord('a') + r)) ans.reverse() print(''.join(ans))
n = int(input()) ans = [] while n: n, r = divmod(n - 1, 26) ans.append(chr(ord('a') + r)) ans.reverse() print(''.join(ans))
[["+", 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
55
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int64_t x; cin >> x; vector<int64_t> vec; while (true) { int64_t a = x % 26; if (a == 0) a = 26; vec.push_back(a); x = x / 26; if (x == 0) break;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int64_t x; cin >> x; vector<int64_t> vec; while (true) { int64_t a = x % 26; if (a == 0) { a = 26; x--; } vec.push_back(a); x = x / 26; if (x...
[["+", 0, 52, 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, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
1
127
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef long long ll; int max(int a, int b) { if (a > b) return a; else return b; } int min(int a, int b) { if (a < b) return a; else return b; } int sort(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { ...
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef long long ll; int max(int a, int b) { if (a > b) return a; else return b; } int min(int a, int b) { if (a < b) return a; else return b; } int sort(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { ...
[["+", 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], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
0
215
n = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" l = [] for _ in range(13): rem = n % 26 l.append(rem - 1 if rem else 25) n = n // 26 if n == 0: break; l.reverse() print("".join([alphabet[i] for i in l]))
n = int(input()) alphabet = "abcdefghijklmnopqrstuvwxyz" l = [] for _ in range(20): rem = n % 26 l.append(rem - 1 if rem else 25) n = (n - 1) // 26 if n == 0: break; l.reverse() print("".join([alphabet[i] for i in l]))
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 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
78
/** * author: nayakashutosh9 * college: National Institute of Technology, Rourkela **/ #include <bits/stdc++.h> using namespace std; #define int long long int #define endl "\n" #define mod 1000000007 #define inf 1e18 const int N = 200005; /*******************************************************************/...
/** * author: nayakashutosh9 * college: National Institute of Technology, Rourkela **/ #include <bits/stdc++.h> using namespace std; #define int long long int #define endl "\n" #define mod 1000000007 #define inf 1e18 const int N = 200005; /*******************************************************************/...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
143
n = int(input()) ans = "" while n > 0: re = n % 26 if re != 0: ans = chr(ord('a') + (re - 1)) + ans n = n // 26 else: ans = 'z' + ans; n = n / 26 - 1 print(ans)
n = int(input()) ans = "" while n > 0: re = n % 26 if re != 0: ans = chr(ord('a') + (re - 1)) + ans n = n // 26 else: ans = 'z' + ans; n = n // 26 - 1 print(ans)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676]]
5
72
from sys import stdin, stdout, setrecursionlimit from collections import deque, defaultdict, Counter import math rl = lambda: stdin.readline() rll = lambda: stdin.readline().split() rli = lambda: map(int, stdin.readline().split()) rlf = lambda: map(float, stdin.readline().split()) INF, NINF = float('inf'), float('-in...
from sys import stdin, stdout, setrecursionlimit from collections import deque, defaultdict, Counter import math rl = lambda: stdin.readline() rll = lambda: stdin.readline().split() rli = lambda: map(int, stdin.readline().split()) rlf = lambda: map(float, stdin.readline().split()) INF, NINF = float('inf'), float('-in...
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 12, 658, 8, 652, 3, 4, 0, 657, 17, 33], ["-", 12, 658, 8, 652, 3, 4, 0, 657, 12, 612]]
5
206
#include <bits/stdc++.h> int main() { long n; std::string s; int i; s = "abcdefghijklmnopqrstuvwxyz"; std::string res; res = ""; std::cin >> n; while (n > 0) { i = n % 26; n /= 26; res = s.at(i - 1) + res; } std::cout << res; }
#include <bits/stdc++.h> int main() { long n; std::string s; int i; s = "abcdefghijklmnopqrstuvwxyz"; std::string res; res = ""; std::cin >> n; while (n > 0) { n--; i = n % 26; n /= 26; res = s.at(i) + res; } std::cout << res; }
[["+", 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], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
78
#include <iostream> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; string f(long long n) { if (n == 0) { return ""; n--; } return f(n / 26) + string(1, 'a' + n % 26); } int main() { long long n; cin >> n; cout << f(n) << endl; return 0; }
#include <iostream> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; string f(long long n) { if (n == 0) { return ""; } n--; return f(n / 26) + string(1, 'a' + n % 26); } int main() { long long n; cin >> n; cout << f(n) << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
85
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) template <typename Container> bool include(const Container &c, const typename Container::value_type &v) { return (c.end() != std::find(c.begin(), c.end(), v)); } template <class T> vector<T> un...
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) template <typename Container> bool include(const Container &c, const typename Container::value_type &v) { return (c.end() != std::find(c.begin(), c.end(), v)); } template <class T> vector<T> un...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6]]
1
217
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define pb pu...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define pb pu...
[["+", 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], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 12, 13]]
1
176
#include <iostream> #include <string> using namespace std; int main(void) { long long num; cin >> num; int rem = 0; string ans = ""; while (num != 0) { rem = num % 26; num /= 26; ans = char('a' + rem - 1) + ans; } cout << ans << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main(void) { long long num; cin >> num; int rem = 0; string ans = ""; while (num != 0) { num--; rem = num % 26; num /= 26; ans = char('a' + rem) + ans; } cout << ans << endl; return 0; }
[["+", 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], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
76
n=int(input()) ans='' while n>0: ans+=chr(ord('a')+n%26-1) n=n//26 print(ans[::-1])
n=int(input()) ans='' while n>0: n-=1 ans+=chr(ord('a')+n%26) n=n//26 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, 677, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
49
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; int64_t a[100], ct = 0; while (n > 0) { a[ct] = n % 26; n /= 26; ct++; } for (int i = ct - 1; i >= 0; i--) { cout << (char)('a' + a[i] - 1); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; int64_t a[100], ct = 0; while (n > 0) { n--; a[ct] = n % 26; n /= 26; ct++; } for (int i = ct - 1; i >= 0; i--) { cout << (char)('a' + a[i]); } return 0; }
[["+", 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, 16, 12, 74, 51, 23, 0, 16, 17, 33], ["-", 0, 16, 12, 74, 51, 23, 0, 16, 12, 13]]
1
92
import string s = string.ascii_lowercase def f(x, tmp): if x == 0: return "" x -= 1 if x <= 26: return s[x] + tmp else: return f(x // 26, s[x % 26] + tmp) n = int(input()) r = f(n, "") print(r)
import string s = string.ascii_lowercase def f(x, tmp): if x == 0: return "" x -= 1 if x < 26: return s[x] + tmp else: return f(x // 26 , s[x % 26] + tmp) n = int(input()) r = f(n, "") print(r)
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 18]]
5
77
#include <bits/stdc++.h> #include <cmath> #include <limits> #include <math.h> using namespace std; using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vector<int>>; using vll = vector<long long>; using vvll = vector<vector<long long>>; #define PI ...
#include <bits/stdc++.h> #include <cmath> #include <limits> #include <math.h> using namespace std; using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vector<int>>; using vll = vector<long long>; using vvll = vector<vector<long long>>; #define PI ...
[["+", 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
165
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections import copy def main(): n = int(input()) ans = "" alpa = "abcdefghijklmnopqrstuvwxyz" while n: ans += alpa[n%26-1] n//=26 ans2 = "" ...
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections import copy def main(): n = int(input()) ans = "" alpa = "abcdefghijklmnopqrstuvwxyz" while n: ans += alpa[n%26-1] n-=1 n//=26 ...
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22]]
5
106
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections import copy import bisect if __name__ == "__main__": n = int(input()) a = [0]*18 a[0] = 26 b = 2 alpa = ["a","b","c","d","e","f","g","h","i","j","k","l...
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections import copy import bisect if __name__ == "__main__": n = int(input()) a = [0]*18 a[0] = 26 b = 2 alpa = ["a","b","c","d","e","f","g","h","i","j","k","l...
[["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]]
5
309
// Author: A_S_M_M@sud_P@rvez #include <bits/stdc++.h> using namespace std; #define MP \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ ...
// Author: A_S_M_M@sud_P@rvez #include <bits/stdc++.h> using namespace std; #define MP \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ ...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 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]]
1
159
def solve(n): s = [chr(ord("a")+i) for i in range(26)] res = "" while n > 0: res = s[n % 26 - 1] + res n //=26 return res n = int(input()) print(solve(n))
def solve(n): s = [chr(ord("a")+i) for i in range(26)] res = "" while n > 0: n -= 1 res = s[n % 26] + res n //=26 return res n = int(input()) print(solve(n))
[["+", 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, 12, 612]]
5
69
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (in...
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (in...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
479
#include <bits/stdc++.h> #define VI vector<int> #define SI set<int> #define QI queue<int> #define PII pair<int, int> #define MP make_pair #define PB push_back #define REP(i, a, b) for (int i = a; i < b; ++i) #define F for (int i = 0; i < n; ++i) #define FIO ...
#include <bits/stdc++.h> #define VI vector<int> #define SI set<int> #define QI queue<int> #define PII pair<int, int> #define MP make_pair #define PB push_back #define REP(i, a, b) for (int i = a; i < b; ++i) #define F for (int i = 0; i < n; ++i) #define FIO ...
[["+", 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, 11, 12, 74, 51, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 74, 51, 23, 0, 16, 12, 13]]
1
123
n = int(input()) res = '' while n > 0: n, t = divmod(n, 26) if t == 0: t = 26 res += chr(96+t) print(res[::-1])
n = int(input()) res = '' while n > 0: n, t = divmod(n, 26) if t == 0: t = 26 n -= 1 res += chr(96+t) print(res[::-1])
[["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612]]
5
53
n = int(input()) res = '' while 0 < n: r = n % 26 res += chr(r+ord('a')-1) n //= 26 print(res[::-1])
n = int(input()) res = '' while 0 < n: n -= 1 r = n % 26 res += chr(r+ord('a')) # print(res) n //= 26 print(res[::-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, 677, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
50
n=int(input()) ans="" while n>0: ans+=chr(96+n%26) n=n//26 print(ans[::-1])
n=int(input()) ans="" while n>0: n-=1 ans+=chr(97+n%26) n=n//26 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, 677, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 677, 12, 652, 3, 4, 0, 657, 31, 612]]
5
42
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #...
[["+", 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], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
418
N = int(input()) a = 26 counter = 1 while a<N: N -= a counter += 1 a *= 26 ans = [] N -= 1 while N>26: ans.append(N%26) N = N //26 ans.append(N) #print(ans) dic = ["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"] ans = [dic[i] fo...
N = int(input()) a = 26 counter = 1 while a<N: N -= a counter += 1 a *= 26 ans = [] N -= 1 while N>=26: ans.append(N%26) N = N //26 ans.append(N) dic = ["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"] ans = [dic[i] for i in ans[...
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
211
n = int(input()) kouho = [chr(i) for i in range(97, 97+26)] ans = [] while n>0: ans.append(kouho[n%26-1]) n = n//26 ans.reverse() print(''.join(ans))
n = int(input()) kouho = [chr(i) for i in range(97, 97+26)] ans = [] while n>0: n-=1 ans.append(kouho[n%26]) n = n//26 ans.reverse() print(''.join(ans))
[["+", 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, 652, 3, 4, 0, 206, 206, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
69
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n; string ans, alph = "zabcdefghijklmnopqrstuvwxy"; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; while (n > 0) { ans += alph[n % 26]; n /= 26; } for (int i = ans.size() - 1; i >= 0; --i) cout << ans[...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n; string ans, alph = "abcdefghijklmnopqrstuvwxyz"; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; while (n > 0) { --n; ans += alph[n % 26]; n /= 26; } for (int i = ans.size() - 1; i >= 0; --i) cou...
[["-", 0, 30, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 0, 30, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 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]]
1
103
n = int(input()) alphabet = 'abcdefghijklmnopqrstuvwxyz' def name(n): if n <= 26: return alphabet[n - 1] else: return name(n // 26) + name(n % 26) print(name(n))
n = int(input()) alphabet = 'abcdefghijklmnopqrstuvwxyz' def name(n): if n <= 26: return alphabet[n - 1] else: return name((n - 1) // 26) + name(n % 26) print(name(n))
[["+", 31, 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], ["+", 31, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
54
#include <algorithm> #include <iostream> #include <string> using namespace std; int value[1005]; int main() { int n; cin >> n; string s; do { s += (char)((n - 1) % 26 + 'a'); n = (n - 1) / 26; } while (n > 0); cout << s << endl; }
#include <algorithm> #include <iostream> #include <string> using namespace std; int value[1005]; int main() { long long n; cin >> n; string s; do { s = (char)((n - 1) % 26 + 'a') + s; n = (n - 1) / 26; } while (n > 0); cout << s << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 82, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 82, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
77
N = int(input()) x = 1 alphabet = {i-96:chr(i) for i in range(97, 97+26)} if int(N) > 26: ans = '' while x != 0: x = N // 26 mod = N%26 #print(x, mod) if mod == 0: ans += 'z' x -= x%26 else: #print(x, mod, alphabet[mod]) ans += ...
N = int(input()) x = 1 alphabet = {i-96:chr(i) for i in range(97, 97+26)} if int(N) > 26: ans = '' while x != 0: x = N // 26 mod = N%26 #print(x, mod) if mod == 0: ans += 'z' #x -= x%26 x -= 1 else: #print(x, mod, alphabet[mod])...
[["-", 64, 196, 0, 1, 0, 677, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 17, 109], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612]]
5
110
strings = sorted(a) N = int(input()) set_index = '' while N > 0: N -= 1 index = (N % 26) + ord('a') set_index += chr(index) N //= 26 print(set_index[::-1])
N = int(input()) set_index = '' while N > 0: N -= 1 index = (N % 26) + ord('a') set_index += chr(index) N //= 26 print(set_index[::-1])
[["-", 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, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
59
alp=['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'] n=int(input()) ans="" while n>0: a=n%26 ans+=alp[a-1] n=int(n//26) print(ans[::-1])
alp=['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'] n=int(input()) ans="" while n>0: n-=1 a=n%26 ans+=alp[a] n=int(n//26) 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
155
// https://atcoder.jp/contests/abc171/tasks/abc171_c #include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) FOR(i, 0, n) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() ...
// https://atcoder.jp/contests/abc171/tasks/abc171_c #include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) FOR(i, 0, n) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() ...
[["+", 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, 11, 12, 23, 0, 16, 17, 33], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
137
n = int(input()) ans="" while(n): ans += chr(ord('a')+(n%26)-1) n = n//26 print(ans[::-1])
n = int(input()) ans="" while(n): n-=1 ans += chr(ord('a')+(n%26)) n = n//26 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, 677, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
51
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); char[] s = new char[26]; for (int i = 0; i < 25; i++) { s[i] = (char)('a' + i); // System.out.print(i+1+" "); // System.out.println((char) ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); char[] s = new char[26]; for (int i = 0; i < 26; i++) { s[i] = (char)('a' + i); // System.out.print(i+1+" "); // System.out.println((char) ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 499]]
3
192
#include <bits/stdc++.h> using namespace std; #define ALL(A) A.begin(), A.end() #define MEM(a, b) memset(a, b, sizeof(a)) #define FOR(n) for (int i = 0; i < n; ++i) #define FOR_(n) for (int i = 1; i <= n; ++i) #define FOR_J(n) for (int j = 0; j < n; ++j) #define FOR_J_(n) for (int j = 1; j <= n; ++j) #define IT_FOR(A) ...
#include <bits/stdc++.h> using namespace std; #define ALL(A) A.begin(), A.end() #define MEM(a, b) memset(a, b, sizeof(a)) #define FOR(n) for (int i = 0; i < n; ++i) #define FOR_(n) for (int i = 1; i <= n; ++i) #define FOR_J(n) for (int j = 0; j < n; ++j) #define FOR_J_(n) for (int j = 1; j <= n; ++j) #define IT_FOR(A) ...
[["+", 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, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
240
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() typedef long long ll; #define _GLIBCXX_DEBUG typedef vector<int> vec; typedef vector<ll> lvec; typedef vector<char> cvec; typedef vector<double> dvec;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() typedef long long ll; #define _GLIBCXX_DEBUG typedef vector<int> vec; typedef vector<ll> lvec; typedef vector<char> cvec; typedef vector<double> dvec;...
[["+", 12, 74, 51, 23, 0, 16, 31, 103, 0, 104], ["+", 12, 74, 51, 23, 0, 16, 31, 103, 0, 125], ["+", 0, 16, 12, 74, 51, 23, 0, 16, 17, 72]]
1
171
#include <bits/stdc++.h> using namespace std; typedef long long LL; LL power(int a, int x) { LL res = 1; while (x) { if (a & 1) res *= a; a *= a, x /= 2; } return res; } int main() { LL range[12] = {}; for (int i = 1; i < 12; i++) { range[i] = range[i - 1] + power(26, i); } LL n, i; ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; LL power(int a, int x) { LL res = 1; while (x) { if (a & 1) res *= a; a *= a, x /= 2; } return res; } int main() { LL range[12] = {}; for (int i = 1; i < 12; i++) { range[i] = range[i - 1] + power(26, i); } LL n, i; ...
[["+", 0, 7, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 7, 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
209
s = "zabcdefghijklmnopqrstuvwxy" n = int(input()) ans = "" while(n>0): r = n%26 if r==0: r = 26 ans = s[r] + ans n -= r n //=26 print(ans)
s = "zabcdefghijklmnopqrstuvwxyz" n = int(input()) ans = "" while(n>0): r = n%26 if r==0: r = 26 ans = s[r] + ans n -= r n //=26 print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
55
n=int(input()) n-=1 i=26 c=1 while n-i>0: n-=i i*=26 c+=1 al=list('abcdefghijklmnopqrstuvwxyz') ans=[] for i in range(c): ans.append(al[n%26]) n=n//26 ans.reverse() print(''.join(ans))
n=int(input()) n-=1 i=26 c=1 while n-i>=0: n-=i i*=26 c+=1 al=list('abcdefghijklmnopqrstuvwxyz') ans=[] for i in range(c): ans.append(al[n%26]) n=n//26 ans.reverse() print(''.join(ans))
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
84
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long l = sc.nextLong(); String ans = ""; while (l-- > 0) { ans = (char)('a' + (l % 26) - 1) + ans; l /= 26; } System.out.println(ans); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long l = sc.nextLong(); String ans = ""; while (l-- > 0) { ans = (char)('a' + (l % 26)) + ans; l /= 26; } System.out.println(ans); } }
[["-", 12, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 12, 499]]
3
91
num = int(input()) s = 'abcdefghijklmnopqrstuvwxyz' ans = '' while num > 0: num, rest = divmod(num, 26) ans += s[rest - 1] #num -= 1 #print(ans, num, rest) print(ans[::-1])
num = int(input()) s = 'abcdefghijklmnopqrstuvwxyz' ans = '' while num > 0: num -= 1 num, rest = divmod(num, 26) ans += s[rest] #if rest == 0: #num -= 1 print(ans[::-1])
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["-", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]]
5
52
#include <algorithm> #include <iostream> using namespace std; int main() { int64_t N, p = 0, r = 0; string name = ""; cin >> N; while (N > 0) { N--; name = name + string(1, 'a' + N % 26); N = N / 26; } cout << name << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { int64_t N, p = 0, r = 0; string name = ""; cin >> N; while (N > 0) { N--; name = string(1, 'a' + N % 26) + name; N = N / 26; } cout << name << endl; }
[["-", 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
75
N = int(input()) lst = [] while N >= 26: lst.insert(0,chr(N % 26 + 96)) N //= 26 lst.insert(0,chr(N+96)) print(*lst,sep="")
N = int(input()) lst = [] while N > 26: N -= 1 lst.insert(0,chr(N % 26 + 97)) N //= 26 lst.insert(0,chr(N+96)) print(*lst,sep="")
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 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], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
58
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9 + 7; void solve() { ll n; cin >> n; if (n <= 26) { cout << char('a' + (n - 1)) << '\n'; return; } string s = ""; while (n > 0) { s += char('a' + (n % 26)) - 1; // cout << n%26 << '\n'; n /= 26; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9 + 7; void solve() { ll n; cin >> n; if (n <= 26) { cout << char('a' + (n - 1)) << '\n'; return; } string s = ""; while (n > 0) { n--; s += char('a' + (n % 26)); // cout << n%26 << '\n'; n /= 26;...
[["+", 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
141
#include <algorithm> #include <iostream> using namespace std; unsigned long long a[100], n, m, p[1000]; string s; int main() { int i, j, k, ans = 0; char c; cin >> n; unsigned long long nn = n; while (nn > 0) { s += (nn % 26 + 'a' - 1); nn /= 26; } for (i = s.size() - 1; i >= 0; i--) cout << s...
#include <algorithm> #include <iostream> using namespace std; unsigned long long a[100], n, m, p[1000]; string s; int main() { int i, j, k, ans = 0; char c; cin >> n; unsigned long long nn = n; while (nn > 0) { nn--; s += (nn % 26 + 'a'); nn /= 26; } for (i = s.size() - 1; i >= 0; i--) cou...
[["+", 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, 11, 12, 23, 0, 16, 17, 33], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
114
n = int(input()) alphabets = [chr(i) for i in range(ord('a'), ord('a') + 26)] ans = '' while n > 0: ans = alphabets[n % 26-1] + ans n = n // 26 print(ans)
n = int(input()) alphabets = [chr(i) for i in range(ord('a'), ord('a') + 26)] ans = '' while n > 0: n -= 1 ans = alphabets[n % 26] + ans n = n // 26 print(ans)
[["+", 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, 12, 612]]
5
67
N = int(input()) N -= 1 s = [] for i in range(12): s.append(chr(ord("a")+N%26)) N //= 26 if N==0: break N -= 1 s.sort() print(*s, sep="")
N = int(input()) N -= 1 s = [] for i in range(12): s.append(chr(ord("a")+N%26)) N //= 26 if N==0: break N -= 1 s.reverse() print(*s, sep="")
[["-", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22]]
5
68
N=int(input()) l=[] while N>0: a=N%26 N=N//26 moji=chr(ord('a')+a-1) l.append(moji) ans=''.join(l) print(ans[::-1])
N=int(input()) l=[] while N>0: N-=1 a=N%26 N=N//26 moji=chr(ord('a')+a) l.append(moji) ans=''.join(l) 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, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
67
n = int(input()) ans = '' while n > 0: n -= 1; ans += chr(ord('a') + n % 26) n //= 26 print(ans)
n = int(input()) ans = '' while n > 0: n -= 1; ans += chr(ord('a') + n % 26) n //= 26 print(ans[::-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
43
N = int(input()) chars = "Xabcdefghijklmnopqrstuvwxyz" ans = "" while True: la = N // 26 sm = N % 26 if sm == 0: sm = 26 la -= 1 ans += chars[sm] N = la if N <= 1: break print(ans[::-1])
N = int(input()) chars = "Xabcdefghijklmnopqrstuvwxyz" ans = "" while True: la = N // 26 sm = N % 26 if sm == 0: sm = 26 la -= 1 ans += chars[sm] N = la if N < 1: break print(ans[::-1])
[["-", 0, 52, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 667, 18]]
5
66
n = int(input()) pre_num = 0 cur_num = 26 length = 1 while n > cur_num: length += 1 pre_num = cur_num cur_num += 26 ** length n -= pre_num name = [] a = ord('a') for _ in range(length): c = n % 26 n //= 26 name.append(chr(a + c)) print(''.join(name[::-1]))
n = int(input()) pre_num = 0 cur_num = 26 length = 1 while n > cur_num: length += 1 pre_num = cur_num cur_num += 26 ** length n -= pre_num + 1 name = [] a = ord('a') for _ in range(length): c = n % 26 n //= 26 name.append(chr(a + c)) print(''.join(name[::-1]))
[["+", 0, 656, 0, 1, 0, 677, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 677, 12, 657, 12, 612]]
5
91
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define P 1000000007 #define CASET \ int ___T; \ scanf("%d", &___T); ...
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define P 1000000007 #define CASET \ int ___T; \ scanf("%d", &___T); ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
174
#include <algorithm> #include <climits> #include <fstream> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { long long N; cin >> N; long long exp; exp = 1; string s = ""; while (N > 0) { N--; int a = N % 26; N++; s = (char)(97 + a) ...
#include <algorithm> #include <climits> #include <fstream> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { long long N; cin >> N; long long exp; exp = 1; string s = ""; while (N > 0) { N--; int a = N % 26; // N++; s = (char)(97 + ...
[["-", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
92
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); String dogName = ""; while (n > 26) { dogName += numberToAlphabet((n - 1) % 26); n = (n - 1) / 26; } dogName += numberToAlphabet(n - 1); ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); String dogName = ""; while (n > 26) { dogName += numberToAlphabet((n - 1) % 26); n = (n - 1) / 26; } dogName += numberToAlphabet(n - 1); ...
[["-", 0, 526, 8, 527, 0, 520, 0, 528, 0, 499], ["+", 0, 526, 8, 527, 0, 520, 0, 528, 0, 499]]
3
401
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() int main() { long long n; cin >> n; vector<char> s; char a; while (n) { n--; a = 'a' + n % 26; ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() int main() { long long n; cin >> n; vector<char> s; char a; while (n) { n--; a = 'a' + n % 26; ...
[["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
1
107
import math N=int(input()) def num2alpha(num): if num<=26: return chr(64+num) elif num%26==0: return str.lower(num2alpha(num//26-1)+chr(90)) else: return str.lower(num2alpha(num//26)+chr(64+num%26)) print(num2alpha(N))
import math N=int(input()) def num2alpha(num): if num<=26: return str.lower(chr(64+num)) elif num%26==0: return str.lower(num2alpha(num//26-1)+chr(90)) else: return str.lower(num2alpha(num//26)+chr(64+num%26)) print(num2alpha(N))
[["+", 64, 196, 0, 37, 0, 652, 63, 319, 500, 22], ["+", 64, 196, 0, 37, 0, 652, 63, 319, 0, 131], ["+", 64, 196, 0, 37, 0, 652, 63, 319, 319, 22], ["+", 64, 196, 0, 37, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
84
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define mp make_pair #define pb push_back #define forn(n) for (long long...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define mp make_pair #define pb push_back #define forn(n) for (long long...
[["+", 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], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
898
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define all(a) (a).begin(), (a).end() typedef long long ll; int main(void) { ll n; cin >> n; string s; while (true) { s += 'a' + ((n - 1) % 26); if (n <= 26) break; n = (n - 1) % 26 + 1; } rev...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define all(a) (a).begin(), (a).end() typedef long long ll; int main(void) { ll n; cin >> n; string s; while (true) { s += 'a' + ((n - 1) % 26); if (n <= 26) break; n = (n - 1) / 26; } reverse...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
101
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; string s = "abcdefghijklmnopuvqrstwxyz"; vector<long long int> v; while (n > 0) { v.push_back((n % 26) - 1); if (n % 26 == 0) n--; n /= 26; } for (long long int x = v.size() - 1; x >= 0; --x) { if (...
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; string s = "abcdefghijklmnopqrstuvwxyz"; vector<long long int> v; while (n > 0) { v.push_back((n % 26) - 1); if (n % 26 == 0) n--; n /= 26; } for (long long int x = v.size() - 1; x >= 0; --x) { if (...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 104], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 62]]
1
125
import java.util.*; import java.util.Collections; public class Main { public static void main(String[] args) { Scanner sc = null; sc = new Scanner(System.in); long N = sc.nextLong(); String ans = ""; while (N > 0) { ans = (char)('a' + (N % 26 - 1)) + ans; N /= 26; } System.out...
import java.util.*; import java.util.Collections; public class Main { public static void main(String[] args) { Scanner sc = null; sc = new Scanner(System.in); long N = sc.nextLong(); String ans = ""; while (N-- > 0) { ans = (char)('a' + (N % 26)) + ans; N /= 26; } System.out.p...
[["+", 0, 52, 15, 15, 0, 16, 31, 27, 0, 68], ["-", 51, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["-", 51, 23, 0, 16, 12, 23, 0, 16, 12, 499]]
3
101
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
[["+", 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, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
133
n=int(input()) ans="" while n: ans+=chr(n%26+ord("a")-1) n//=26 print(ans[::-1])
n=int(input()) ans="" while n: n-=1 ans+=chr(n%26+ord("a")) n//=26 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, 677, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
45
import string N = int(input()) ans = [] S ="" while N != 0: a = N % 26 b = N // 26 N = b ans.append(a) ans = reversed(ans) for s in ans: S += string.ascii_lowercase[int(s)-1] print(S)
import string N = int(input()) ans = [] S ="" while N != 0: N -= 1 a = N % 26 b = N // 26 N = b ans.append(a) ans = reversed(ans) for s in ans: S += string.ascii_lowercase[int(s)] print(S)
[["+", 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
70
///-----Bismillahir Rahmanir Rahim-----/// #include <bits/stdc++.h> using namespace std; ///---FAST I/O---/// #define Boost() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
///-----Bismillahir Rahmanir Rahim-----/// #include <bits/stdc++.h> using namespace std; ///---FAST I/O---/// #define Boost() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
420
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; string ans; while (N > 0) { N--; ans += (N % 26) + 'a'; N /= 26; } sort(ans.begin(), ans.end()); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; string ans; while (N > 0) { N--; ans += (N % 26) + 'a'; N /= 26; } reverse(ans.begin(), ans.end()); cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
71
n = int(input()) ans = '' for i in range(1, 99): if N <= 26 ** i: N -= 1 for j in range(i): ans += chr(ord('a') + N % 26) N //= 26 break else: N -= 26 ** i print(ans[::-1])
N = int(input()) ans = '' for i in range(1, 99): if N <= 26 ** i: N -= 1 for j in range(i): ans += chr(ord('a') + N % 26) N //= 26 break else: N -= 26 ** i print(ans[::-1])
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
76
# frozen_string_literal: true a = [*'a'..'z'] n = gets.to_i res = [] loop do res << a[n % 26 - 1] n /= 26 break if n == 0 end puts res.reverse.join
# frozen_string_literal: true a = [*'a'..'z'] n = gets.to_i res = [] loop do n -= 1 res << a[n % 26] n /= 26 break if n == 0 end puts res.reverse.join
[["+", 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], ["-", 8, 736, 0, 738, 12, 742, 0, 738, 17, 33], ["-", 8, 736, 0, 738, 12, 742, 0, 738, 12, 612]]
4
49
import java.io.*; import java.math.*; import java.util.*; public class Main { static MyScanner in = new MyScanner(); static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); int N; static int max = 200001; static int[] dr = {1, -1, 0, 0}; static int[] dc = {0, 0, -1, 1}; static bool...
import java.io.*; import java.math.*; import java.util.*; public class Main { static MyScanner in = new MyScanner(); static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); int N; static int max = 200001; static int[] dr = {1, -1, 0, 0}; static int[] dc = {0, 0, -1, 1}; static bool...
[["+", 0, 1, 0, 11, 12, 74, 39, 506, 0, 517], ["+", 8, 196, 0, 1, 0, 11, 12, 74, 0, 25], ["+", 0, 1, 0, 11, 12, 74, 51, 23, 0, 24]]
3
585
// Problem : C - One Quadrillion and One Dalmatians // Contest : AtCoder - AtCoder Beginner Contest 171 // URL : https://atcoder.jp/contests/abc171/tasks/abc171_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) /* ID: vqt LANG: C++14 PROB: namenum */ #...
// Problem : C - One Quadrillion and One Dalmatians // Contest : AtCoder - AtCoder Beginner Contest 171 // URL : https://atcoder.jp/contests/abc171/tasks/abc171_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) /* ID: vqt LANG: C++14 PROB: namenum */ #...
[["+", 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,238
N = int(input()) s = 1 while N > 26 ** s: N -= 26 ** s s += 1 ans = "" N -= 1 for i in range(s): ans += chr(ord("a") + ord(N % 26)) N = N // 26 print(ans[::-1])
N = int(input()) s = 1 while N > 26 ** s: N -= 26 ** s s += 1 ans = "" N -= 1 for i in range(s): ans += chr(ord("a") + N % 26) N = N // 26 print(ans[::-1])
[["-", 12, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]]
5
74
def main(): #input N=int(input()) l=list("zabcdefghijklmnopqrstuvwxy") if N<26: print(l[N]) else: name=[] n=N while n>=26: mod=n%26 if mod!=0: n//=26 else: n//=26 n-=1 name...
def main(): #input N=int(input()) l=list("zabcdefghijklmnopqrstuvwxy") if N<26: print(l[N]) else: name=[] n=N while n>=26: mod=n%26 if mod!=0: n//=26 else: n//=26 n-=1 name...
[["-", 75, 76, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 22]]
5
133
#include <iostream> #include <stdio.h> #include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <string> #include <vector> using namespace std; int main() { long long N; cin >> N; int cou = 0; long long num2 = N; string ans = ""; while (N) { char s = (N - 1) % 26 + 'a'; ...
#include <iostream> #include <stdio.h> #include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <string> #include <vector> using namespace std; int main() { long long N; cin >> N; int cou = 0; long long num2 = N; string ans = ""; while (N) { char s = (N - 1) % 26 + 'a'; ...
[["+", 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
108
import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong() - 1; ArrayList<Character> list = new ArrayList<>(); while (n > 0) { list.add((char)('a' + n % 26)); n /= 26; n--; ...
import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong() - 1; ArrayList<Character> list = new ArrayList<>(); while (n >= 0) { list.add((char)('a' + n % 26)); n /= 26; n--;...
[["-", 8, 196, 0, 52, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 17, 20]]
3
133
N = int(input()) max_limit = 1000000000000001 now = 0 for i in range(1,20): now += 26**i if now >= N: keta = i break for i in range(keta): if i != 0: N -= 26**(i) N = N-1 answer_list = [] for i in range(keta-1): answer_list.append(N//26**(keta-(i+1))) N = N%26**(keta-(...
N = int(input()) max_limit = 1000000000000001 now = 0 for i in range(1,20): now += 26**i if now >= N: keta = i break for i in range(keta): if i != 0: N -= 26**(i) N = N-1 answer_list = [] for i in range(keta-1): answer_list.append(N//26**(keta-(i+1))) N = N%26**(keta-(...
[["-", 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
162
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define puts(i) cout << i << endl #define pi 3.14159265358979323846264338 #define pb push_back #define mp make_pair #define inf 10000 using ll = long long; using P = pair<int, int>; using Pll = pair<ll, ll>; ll divisor = 100000...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define puts(i) cout << i << endl #define pi 3.14159265358979323846264338 #define pb push_back #define mp make_pair #define inf 10000 using ll = long long; using P = pair<int, int>; using Pll = pair<ll, ll>; ll divisor = 100000...
[["+", 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, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
143
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define PI 3.14159265358979323846 #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define rep1(x, n) for (l...
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define PI 3.14159265358979323846 #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define rep1(x, n) for (l...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89]]
1
124
n=int(input()) ans=[] while n>26: tmp=n%26 if tmp==0: tmp=26 ans.append(tmp) n=n//26 ans.append(n) ans=ans[::-1] for a in ans: print(chr(a+96),end="")
n=int(input()) ans=[] while n>26: tmp=n%26 if tmp==0: tmp=26 n-=1 ans.append(tmp) n=n//26 ans.append(n) ans=ans[::-1] for a in ans: print(chr(a+96),end="")
[["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612]]
5
75
#include <bits/stdc++.h> using namespace std; #define int long long #define w(x) \ int x; \ cin >> x; \ while (...
#include <bits/stdc++.h> using namespace std; #define int long long #define w(x) \ int x; \ cin >> x; \ while (...
[["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
322
n = int(input()) l = ["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"] answer = [] while n >= 1: n -= 1 print(n) answer.append(l[n % 26]) n = n//26 ans = ''.join(list(reversed(answer))) print(ans)
n = int(input()) l = ["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"] answer = [] while n >= 1: n -= 1 answer.append(l[n % 26]) n = n//26 ans = ''.join(list(reversed(answer))) print(ans)
[["-", 0, 52, 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
166
/* 西江月·证明 即得易见平凡,仿照上例显然。 留作习题答案略, 读者自证不难。 反之亦然同理,推论自然成立。 略去过程QED,由上可知证毕。*/ #pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #include <algorithm> #include <cstdio> #include <iostream> #include <queue> #define kkk register #define ll lo...
/* 西江月·证明 即得易见平凡,仿照上例显然。 留作习题答案略, 读者自证不难。 反之亦然同理,推论自然成立。 略去过程QED,由上可知证毕。*/ #pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #include <algorithm> #include <cstdio> #include <iostream> #include <queue> #define kkk register #define ll lo...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
242
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; (i) < (int)(n); (i)++) using namespace std; int main() { long long n; cin >> n; string ans; while (n) { int a = n % 26; ans.push_back('a' + a - 1); n /= 26; } reverse(ans.begin(), ans.end()); cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; (i) < (int)(n); (i)++) using namespace std; int main() { long long n; cin >> n; string ans; while (n) { n--; int a = n % 26; ans.push_back('a' + a); n /= 26; } reverse(ans.begin(), ans.end()); cout << ans << endl; return 0; }
[["+", 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
85
#include <iostream> #include <string> using namespace std; long long ruizyo(int tei, int sisu) { long long a = 1; for (int i = 0; i < sisu; i++) a *= tei; return a; } int hikicount(long long &higensu, long long gensu) { int i = 0; while (higensu > gensu) { higensu -= gensu; i++; } return i;...
#include <iostream> #include <string> using namespace std; long long ruizyo(int tei, int sisu) { long long a = 1; for (int i = 0; i < sisu; i++) a *= tei; return a; } int hikicount(long long &higensu, long long gensu) { int i = 0; while (higensu > gensu) { higensu -= gensu; i++; } return i;...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
205
#include <bits/stdc++.h> #define DAU \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define PLEC exit(0); using namespace...
#include <bits/stdc++.h> #define DAU \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define PLEC exit(0); using namespace...
[["+", 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, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
80
/* -------------------- | LOSER | | ~NOOBOSS~ | -------------------- */ #include <bits/stdc++.h> using namespace std; #define inl(x) scanf("%lld", &x) #define in(x) scanf("%d", &x) #define mxx 10000000000000 #define mnn -10000000000000 #define Y() cout << "YES" << endl #define N() ...
/* -------------------- | LOSER | | ~NOOBOSS~ | -------------------- */ #include <bits/stdc++.h> using namespace std; #define inl(x) scanf("%lld", &x) #define in(x) scanf("%d", &x) #define mxx 10000000000000 #define mnn -10000000000000 #define Y() cout << "YES" << endl #define N() ...
[["+", 0, 52, 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], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
540
#include <bits/stdc++.h> using namespace std; #define ll long long #define OJ \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); int main() { // OJ; ios_base::sync_with_stdio(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define OJ \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); int main() { // OJ; ios_base::sync_with_stdio(...
[["+", 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
98
n = int(input()) ans = '' while n > 0: a = n % 26 ans += chr(ord('a') + a - 1) n //= 26 print(ans[::-1])
n = int(input()) ans = '' while n > 0: n -= 1 a = n % 26 ans += chr(ord('a') + a) n //= 26 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, 677, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
50
N = int(input()) ans = '' for i in range(1, 99): if N <= 26 ** i: N -= 1 for j in range(i): ans += chr(ord('a') + N % 26) N //= 26 break else: N -= 26 ** i print(ans[::-1])
N = int(input()) ans = "" for i in range(1,99): if N<=26**i: N-=1 for j in range(i): ans += chr(ord("a")+ N%26) N//=26 break else: N-=26**i print(ans[::-1])
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 654], ["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 655], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 654], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 655], ["-", 0, 657, 31, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 657, 31, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 657, 31, 652, 3, 4, 0, 557, 0, 655...
5
76
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N, i, k; cin >> N; ll a[111111]; k = 0; while (N > 0) { a[k] = N % 26; N = (N - a[k]) / 26; k++; } for (i = k - 1; i >= 0; i--) cout << (char)(a[i] - 1 + 'a'); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N, i, k; cin >> N; ll a[111111]; k = 0; while (N > 0) { N--; a[k] = N % 26; N = (N - a[k]) / 26; k++; } for (i = k - 1; i >= 0; i--) cout << (char)(a[i] + 'a'); }
[["+", 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], ["-", 12, 74, 51, 23, 0, 16, 31, 16, 17, 33], ["-", 12, 74, 51, 23, 0, 16, 31, 16, 12, 13]]
1
104