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
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (n > 0) { n--; int t = (int)(n % 26); sb.append((char)(97 + t)); n = n / 26; } Sy...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (n > 0) { n--; int t = (int)(n % 26); sb.insert(0, (char)('a' + t)); n = n / 26; } ...
[["-", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 499], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 21], ["-", 3, 4, 0, 74, 51, 23, 0, 16, 31, 499], ["+", 3, 4, 0, 74, 51, 23, 0, 16, 31, 252]]
3
108
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define reps(i, n) for (ll i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (ll i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (ll i = ((int)(n)); i > 0; --i) #define ll long long #define ALL(x) (x).begin(), (x).end() #define...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define reps(i, n) for (ll i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (ll i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (ll i = ((int)(n)); i > 0; --i) #define ll long long #define ALL(x) (x).begin(), (x).end() #define...
[["+", 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, 23, 0, 16, 31, 16, 17, 33], ["-", 0, 11, 12, 23, 0, 16, 31, 16, 12, 13]]
1
251
n=int(input()) ans = '' while n: tmp = (n-1)%26 ans += chr(ord('a')+tmp) n//=26 print(ans[::-1])
n=int(input()) ans = '' while n: tmp = (n-1)%26 ans += chr(ord('a')+tmp) n-=1 n//=26 print(ans[::-1])
[["+", 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
50
def main(): alphabet = list(chr(i)for i in range(97, 123)) n = int(input()) ans = '' while n > 0: n -= 1 ans += chr(ord('a') + (n % 26)) n //= 26 print(ans) if __name__ == "__main__": main()
def main(): alphabet = list(chr(i)for i in range(97, 123)) n = int(input()) ans = '' while n > 0: n -= 1 ans = chr(ord('a') + (n % 26)) + ans n = n//26 print(ans) if __name__ == "__main__": main()
[["-", 0, 52, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 52, 8, 196, 0, 1, 0, 677, 17, 691], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676]]
5
77
import string n = int(input()) s = string.ascii_lowercase ans = '' while n != 0: n -= 1 ans += s[n%26] n = n // 26 print(ans)
import string n = int(input()) s = string.ascii_lowercase ans = '' while n != 0: n -= 1 ans += s[n%26] n = 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
44
N = int(input()) L = list("abcdefghijklmnopqrstuvwxyz") a = 1 while N > 26**a: N = N - 26**a a += 1 pre = [] for i in reversed(range(1,a)): r = N // 26**i pre.append(r) N = int(N%(26**i)) ans = '' for i in pre: ans += L[i] print(ans+L[N-1])
N = int(input()) L = list("abcdefghijklmnopqrstuvwxyz") a = 1 while N > 26**a: N = N - 26**a a += 1 pre = [] for i in reversed(range(1,a)): r = (N-1) // 26**i pre.append(r) N = int(N%(26**i)) ans = '' for i in pre: ans += L[i] print(ans+L[N-1])
[["+", 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
104
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 52, 0, 89], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 64, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
415
#include "bits/stdc++.h" using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \ c i) { sim > ...
#include "bits/stdc++.h" using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \ c i) { sim > ...
[["+", 8, 9, 0, 52, 15, 339, 51, 27, 17, 68], ["-", 0, 11, 12, 74, 51, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 74, 51, 23, 0, 16, 12, 13]]
1
595
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { long long int n; cin >> n; string s = ""; while (n != 0) { int k = n % 26; if (k == 0) { k = 26; } s = s + (char)(k + 96); n = n / 26; } reverse(s.begin(), s.end()); cout << s << endl; return 0;...
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { long long int n; cin >> n; string s = ""; while (n != 0) { int k = n % 26; if (k == 0) { k = 26; } s = s + (char)(k + 96); n = n - k; n = n / 26; } reverse(s.begin(), s.end()); cout << s << end...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]]
1
99
n = int(input()) alp = 'abcdefghijklmnopqrstuvwxyz' # 名前の長さを求める min_n = 0 max_n = 26 l = 1 while min_n < n <= max_n: min_n += max_n max_n += max_n * 26 l += 1 # n - min_n 番目の名前を求める <=> n - min_n - 1 を26進数に変換 m = n - min_n - 1 ans = '' while m >= 26: ans = alp[m % 26] + ans m = m // 26 - 1 ans = al...
n = int(input()) alp = 'abcdefghijklmnopqrstuvwxyz' # 名前の長さを求める min_n = 0 max_n = 26 l = 0 while min_n < n <= max_n: min_n += max_n max_n += max_n * 26 l += 1 # n - min_n 番目の名前を求める <=> n - min_n - 1 を26進数に変換 m = n - min_n - 1 ans = '' while m >= 26: ans = alp[m % 26] + ans m = m // 26 - 1 ans = al...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
102
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define fast ...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define fast ...
[["+", 8, 9, 0, 52, 8, 9, 0, 57, 0, 121], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 8, 9, 0, 57, 15, 339, 51, 91, 28, 22], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 25]]
1
315
#pragma GCC optimize("Ofast") #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iost...
#pragma GCC optimize("Ofast") #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iost...
[["+", 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], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 12, 13]]
1
162
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <stdio.h> #include <string> #include <vector> typedef long long ll; using namespace std; int main() { ll N; cin >> N; vector<char> cs; int q; while (N != 0) { q = N % 26; if (q == 0) { cs.push_back('z'); N ...
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <stdio.h> #include <string> #include <vector> typedef long long ll; using namespace std; int main() { ll N; cin >> N; vector<char> cs; int q; while (N != 0) { q = N % 26; if (q == 0) { cs.push_back('z'); N ...
[["+", 3, 4, 0, 16, 31, 16, 31, 103, 0, 104], ["+", 3, 4, 0, 16, 31, 16, 31, 103, 0, 125], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
134
n = int(input()) ans = "" while n: n -= 1 ans += chr(97 + n % 26) n //= 26 print(ans)
n = int(input()) ans = "" while n: n -= 1 ans += chr(97 + 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
35
#include <algorithm> #include <cmath> #include <cstdint> #include <iostream> #include <string> #include <vector> using namespace std; int main() { uint64_t N; cin >> N; uint64_t pl = 1; int i = 1; for (;; ++i) { uint64_t l = 1; for (int j = 1; j < i; ++j) { l += pow(26, j); } if (l > N...
#include <algorithm> #include <cmath> #include <cstdint> #include <iostream> #include <string> #include <vector> using namespace std; int main() { uint64_t N; cin >> N; uint64_t pl = 1; int i = 1; for (;; ++i) { uint64_t l = 1; for (int j = 1; j < i; ++j) { l += pow(26, j); } if (l > N...
[["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 13]]
1
170
#include <bits/stdc++.h> #define INF 2147483640 using namespace std; unsigned long long a[20]; int main() { // freopen("out.txt","w",stdout); for (unsigned long long i = 1, j = 26; i <= 11; i++, j *= 26) a[i] = j; unsigned long long n, len, sum = 0; cin >> n; n--; for (len = 1;; len++) { if (sum + a...
#include <bits/stdc++.h> #define INF 2147483640 using namespace std; unsigned long long a[20]; int main() { // freopen("out.txt","w",stdout); for (unsigned long long i = 1, j = 26; i <= 11; i++, j *= 26) a[i] = j; unsigned long long n, len, sum = 0; cin >> n; n--; for (len = 1;; len++) { if (sum + a...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
173
#include <algorithm> #include <iostream> #include <string> int main() { long long N; long long p; std::cin >> N; std::string result; while (N) { p = N % 26; result += 'a' + p; N = N / 26; } std::reverse(result.begin(), result.end()); std::cout << result; }
#include <algorithm> #include <iostream> #include <string> int main() { long long N; long long p; std::cin >> N; std::string result; while (N) { N -= 1; p = N % 26; result += 'a' + p; N = N / 26; } std::reverse(result.begin(), result.end()); std::cout << result; }
[["+", 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]]
1
80
#include <algorithm> #include <chrono> #include <cmath> #include <fstream> #include <iostream> #include <string> #include <vector> using namespace std; using namespace chrono; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<in...
#include <algorithm> #include <chrono> #include <cmath> #include <fstream> #include <iostream> #include <string> #include <vector> using namespace std; using namespace chrono; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<in...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13]]
1
381
no = gets.to_i name = '' while no > 0 do div, mod = no.divmod(26) if mod.zero? div -= 1 mod = 26 end name = ('a'.ord - 1 + mod).chr + name no = div end puts name.reverse
no = gets.to_i name = '' while no > 0 do div, mod = no.divmod(26) if mod.zero? div -= 1 mod = 26 end name = ('a'.ord - 1 + mod).chr + name no = div end puts name
[["-", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
60
def c171(n): ans = "" while n > 0: ans += chr(ord('a') + n % 26 - 1) n //= 26 return ans[::-1] def main(): n = int(input()) print(c171(n)) if __name__ == '__main__': main()
def c171(n): ans = "" while n > 0: n -= 1 ans += chr(ord('a') + n % 26) n //= 26 return ans[::-1] def main(): n = int(input()) print(c171(n)) if __name__ == '__main__': main()
[["+", 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
73
#include <algorithm> #include <iostream> #include <vector> #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) #define INF 1001001001 using namespace std; int main(void) { unsigned long long n; string ans; cin >> n; while (n) { ans += (char)('a' + (n % 26) - 1); n /= ...
#include <algorithm> #include <iostream> #include <vector> #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) #define INF 1001001001 using namespace std; int main(void) { unsigned long long n; string ans; cin >> n; while (n) { n--; ans += (char)('a' + (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], ["-", 0, 11, 12, 74, 51, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 74, 51, 23, 0, 16, 12, 13]]
1
101
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) begin(x), end(x) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { ll n; cin >> n; ll keta = 1; while (1) { if (n - powl(26, keta) <= 0) break; n -= powl(26, keta); keta++; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) begin(x), end(x) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { ll n; cin >> n; ll keta = 1; while (1) { if (n - powl(26, keta) <= 0) break; n -= powl(26, keta); keta++; ...
[["+", 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, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
1
163
#include <bits/stdc++.h> using namespace std; int main(void) { // Your code here! long long int n; string ans; cin >> n; while (n) { n--; ans += 'a' + n % 26; n /= 26; } sort(ans.rbegin(), ans.rend()); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { // Your code here! long long int n; string ans; cin >> n; while (n) { n--; ans += 'a' + n % 26; 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], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]]
1
70
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector<char> c; while (n > 1) { n--; int x = n % 26; if (x == -1) { c.push_back('z'); n /= 26; } else { char a = 'a'; a += x;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector<char> c; while (n >= 1) { n--; int x = n % 26; if (x == -1) { c.push_back('z'); n /= 26; } else { char a = 'a'; a += x...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
138
#include <bits/stdc++.h> using namespace std; const vector<char> chars = {'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'}; int main() { ios::sync_with_stdio(false); cin.tie(0)...
#include <bits/stdc++.h> using namespace std; const vector<char> chars = {'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'}; int main() { ios::sync_with_stdio(false); cin.tie(0)...
[["+", 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
203
#include <bits/stdc++.h> using namespace std; #define int long long string convertToTitle(int n) { string s = ""; int r; if (n < 27) { s += (char)(n - 1 + 'A'); return s; } while (n > 0) { r = n % 26; if (r == 0) { s = 'Z' + s; n = (int)((n - 26) / 26); } else { s = (char...
#include <bits/stdc++.h> using namespace std; #define int long long string convertToTitle(int n) { string s = ""; int r; if (n < 27) { s += (char)(n - 1 + 'a'); return s; } while (n > 0) { r = n % 26; if (r == 0) { s = 'z' + s; n = (int)((n - 26) / 26); } else { s = (char...
[["-", 12, 74, 51, 23, 0, 16, 12, 103, 0, 125], ["+", 12, 74, 51, 23, 0, 16, 12, 103, 0, 125], ["-", 0, 1, 0, 11, 12, 16, 31, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 16, 31, 103, 0, 125], ["-", 31, 74, 51, 23, 0, 16, 12, 103, 0, 125], ["+", 31, 74, 51, 23, 0, 16, 12, 103, 0, 125], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], [...
1
153
#include <iostream> #include <vector> using namespace std; using ll = long long; int main() { ll n; cin >> n; vector<int> a; while (n != 0) { a.push_back(n % 26); n /= 26; } for (int i = a.size() - 1; i >= 0; --i) { cout << (char)(a[i] + 96); } cout << endl; return 0; }
#include <iostream> #include <vector> using namespace std; using ll = long long; int main() { ll n; cin >> n; vector<int> a; while (n != 0) { n--; a.push_back(n % 26); n /= 26; } for (int i = a.size() - 1; i >= 0; --i) { cout << (char)(a[i] + 97); } cout << 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, 16, 12, 74, 51, 23, 0, 16, 12, 13], ["+", 0, 16, 12, 74, 51, 23, 0, 16, 12, 13]]
1
97
roman = "abcdefghijklmnopqrstuvwxyz" num_to_roman = {} for i in range(26): num_to_roman[i+1] = roman[i] n = int(input()) ans = [] while(n): ans.insert(0, num_to_roman[n%26]) n = n//26 ans_str = ''.join(ans) print(ans_str)
roman = "abcdefghijklmnopqrstuvwxyz" num_to_roman = {} for i in range(26): num_to_roman[i] = roman[i] n = int(input()) ans = [] while(n): n-=1 ans.insert(0,num_to_roman[n%26]) n = n//26 ans_str = ''.join(ans) print(ans_str)
[["-", 0, 1, 0, 662, 31, 206, 206, 657, 17, 72], ["-", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612], ["+", 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]]
5
76
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; // const ll MOD = 998244353; const ll INF = MOD * MOD; const long double EPS = 1e-12; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); }...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; // const ll MOD = 998244353; const ll INF = MOD * MOD; const long double EPS = 1e-12; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); }...
[["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
13,904
#include <algorithm> #include <bits/stdc++.h> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #includ...
[["+", 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
9,376
#include <algorithm> #include <iostream> using namespace std; int main() { long long n; cin >> n; string o = ""; while (n > 0) { o += 'a' + (n % 26) - 1; n /= 26; } reverse(o.begin(), o.end()); cout << o << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { long long n; cin >> n; string o = ""; while (n > 0) { n--; o += 'a' + (n % 26); n /= 26; } reverse(o.begin(), o.end()); cout << o << 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], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
75
#include <bits/stdc++.h> typedef long long ll; #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) #define rep(i, n) for (int i = 0; i < (n); ++i) #define AA(i) cout << i << endl; #define AS(i) cout << i << " "; const int INF = 1001001001; const double PI = 3.14159; using namespace std; int main() { ...
#include <bits/stdc++.h> typedef long long ll; #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) #define rep(i, n) for (int i = 0; i < (n); ++i) #define AA(i) cout << i << endl; #define AS(i) cout << i << " "; const int INF = 1001001001; const double PI = 3.14159; using namespace std; int main() { ...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107]]
1
118
N=int(input()) List='abcdefghijklmnopqrstuvdxyz' Ans='' while N>=1: Amari=N%26 if Amari==0: Ans='z'+Ans else: Ans=List[Amari-1]+Ans N=(N-1)//26 print(Ans)
N=int(input()) List='abcdefghijklmnopqrstuvwxy' Ans='' while N>=1: Amari=N%26 if Amari==0: Ans='z'+Ans else: Ans=List[Amari-1]+Ans N=(N-1)//26 print(Ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
64
N = input() s = "abcdefghijklmnopqrstuvwxyz" ans = "" n, m = 0, 0 for i in range(1, 1000): m += 26 ** i if N <= m: n = i break for i in range(n): a, b = divmod(N, 26) N = a if b == 0: ans += s[25] N -= 1 else: ans += s[b-1] ans1 = ''.join(list(reversed...
N = int(input()) s = "abcdefghijklmnopqrstuvwxyz" ans = "" n, m = 0, 0 for i in range(1, 1000): m += 26 ** i if N <= m: n = i break for i in range(n): a, b = divmod(N, 26) N = a if b == 0: ans += s[25] N -= 1 else: ans += s[b-1] ans1 = ''.join(list(rev...
[["+", 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
109
N = int(input()) ans = "" li = "abcdefghijklmnopprstuvwxyz" while N > 0: N -= 1 ans += li[N % 26] N //= 26 print(ans[::-1])
N = int(input()) ans = "" li = "abcdefghijklmnopqrstuvwxyz" while N > 0: N -= 1 ans += li[N % 26] N //= 26 print(ans[::-1])
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
46
N = int(input()) name = '' while N!=0: name = chr(ord('a')-1+N%26) + name N = N//26 print(name)
N = int(input()) name = '' while N!=0: N -= 1 name = chr(ord('a')+N%26) + name N = N//26 print(name)
[["+", 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], ["-", 31, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["-", 31, 652, 3, 4, 0, 657, 31, 657, 12, 612]]
5
45
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <tuple> #include <utility> #include <vector> #define...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <tuple> #include <utility> #include <vector> #define...
[["+", 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, 2, 3, 4, 0, 16, 17, 33], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
153
from math import floor,ceil,sqrt,factorial,log from collections import Counter, deque from functools import reduce import numpy as np import itertools def S(): return input() def I(): return int(input()) def MS(): return map(str,input().split()) def MI(): return map(int,input().split()) def FLI(): return [int(i) for i ...
from math import floor,ceil,sqrt,factorial,log from collections import Counter, deque from functools import reduce import numpy as np import itertools def S(): return input() def I(): return int(input()) def MS(): return map(str,input().split()) def MI(): return map(int,input().split()) def FLI(): return [int(i) for i ...
[["+", 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
308
n = int(input()) mod = 26 i= 0 name = '' while n>0: n -= 1 name += chr(ord('a')+n%mod) n //= mod print(name)
n = int(input()) mod = 26 i= 0 name = '' while n>0: n -= 1 name += chr(ord('a')+n%mod) n //= mod print(name[::-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
48
n = 123456789 m = {} for i in range(0,26): m[i] = chr(97+i) ans = '' while 1: n -= 1 x = n // 26 y = n % 26 ans = m[y] + ans n = x if n == 0: break print(ans)
n = int(input()) m = {} for i in range(0,26): m[i] = chr(97+i) ans = '' while 1: n -= 1 x = n // 26 y = n % 26 ans = m[y] + ans n = x if n == 0: break print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
69
N = int(input()) ans = "" while N > 0: N -= 1 ans += chr(97 + N%26) N = N // 26 print(ans)
N = int(input()) ans = "" while N > 0: N -= 1 ans += chr(97 + N%26) N = 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
39
n = int(input()) ans = "" while n: n -= 1 ans = chr(96 + n % 26) + ans n //= 26 print(ans)
n = int(input()) ans = "" while n: n -= 1 ans = chr(97 + n % 26) + ans n //= 26 print(ans)
[["-", 12, 657, 31, 652, 3, 4, 0, 657, 31, 612], ["+", 12, 657, 31, 652, 3, 4, 0, 657, 31, 612]]
5
37
def solve(): N = int(input()) k = 1 while N>pow(26,k): N -= pow(26,k) k += 1 ans = '' N -= 1 for i in range(k,1,-1): ans += chr(ord('a')+N//pow(26,i-1)) N%=pow(26,i-1) ans += chr(ord('a')+N%pow(26,i)) return ans print(solve())
def solve(): N = int(input()) k = 1 while N>pow(26,k): N -= pow(26,k) k += 1 ans = '' N -= 1 for i in range(k,1,-1): ans += chr(ord('a')+N//pow(26,i-1)) N%=pow(26,i-1) ans += chr(ord('a')+N%26) return ans print(solve())
[["-", 3, 4, 0, 657, 12, 657, 12, 652, 63, 22], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 24], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 21], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 22], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 25]]
5
117
N = int(input()) lis = [1,26] num = 26 n = 1 while lis[-1]<N: num *= 26 lis.append(lis[-1]+num) n += 1 c = N-lis[-2]-1 ans = '' for i in range(n): ans = chr(c%26+ord('a')) + ans c //= 26 print(ans)
N = int(input()) lis = [0,26] num = 26 n = 1 while lis[-1]<N: num *= 26 lis.append(lis[-1]+num) n += 1 c = N-lis[-2]-1 ans = '' for i in range(n): ans = chr(c%26+ord('a')) + ans c //= 26 print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 612]]
5
95
def II(): return int(input()) N=II() N-=1 i=1 while N>(26**i): N-=26**i i+=1 ans='' for j in range(i): q,mod=divmod(N,26) ans=ans+chr(mod+ord('a')) N=q ans=ans[::-1] print(ans)
def II(): return int(input()) N=II() N-=1 i=1 while N>=(26**i): N-=26**i i+=1 ans='' for j in range(i): q,mod=divmod(N,26) ans=ans+chr(mod+ord('a')) N=q ans=ans[::-1] print(ans)
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
93
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF = 10010...
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF = 10010...
[["-", 12, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
260
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define io \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define io \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["+", 8, 9, 0, 52, 15, 339, 51, 27, 17, 68], ["-", 49, 50, 51, 16, 31, 16, 31, 23, 0, 24], ["-", 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
190
n = int(input()) ans = '' while n: ans = chr(n%26 + ord('a') - 1) + ans n //= 26 print(ans)
n = int(input()) ans = '' while n: n -= 1 ans = chr(n%26 + ord('a')) + ans 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], ["-", 12, 657, 31, 652, 3, 4, 0, 657, 17, 33], ["-", 12, 657, 31, 652, 3, 4, 0, 657, 12, 612]]
5
41
n = int(input()) x = 0 l = 0 while x < n: l += 1 x += 26**l for i in range(1,l): n -= 26**i n -= 1 ans = "" while n > 0: ans += chr(ord("a")+n%26) n //= 26 print(ans[::-1])
n = int(input()) x = 0 l = 0 while x < n: l += 1 x += 26**l for i in range(1,l): n -= 26**i n -= 1 ans = "" while len(ans) < l: ans += chr(ord("a")+n%26) n //= 26 print(ans[::-1])
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612], ["+", 0, 656, 0, 52, 15, 666, 0, 652, 63, 22], ["+", 0, 52, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 52, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 52, 15, 666, 0, 652, 3, 4, 0, 25],...
5
82
n = int(input()) n -= 1 name = [] while n > 0: modulo = n % 26 name += chr(ord("a")+modulo) #print (modulo) #print (n // 26-1) n = n // 26 - 1 print ("".join(reversed(name)))
n = int(input()) n -= 1 name = [] while n >= 0: modulo = n % 26 name += chr(ord("a")+modulo) #print (modulo) #print (n // 26-1) n = n // 26 - 1 print ("".join(reversed(name)))
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
60
def main(): n = int(input()) ans = '' while n > 26: d = n%26 if d==0: d=26 ans += chr(ord('a')+d-1) n = n//26 ans += chr(ord('a')+n-1) print(ans[::-1]) if __name__ == "__main__": main()
def main(): n = int(input()) ans = '' while n > 26: d = n%26 if d==0: d=26 ans += chr(ord('a')+d-1) n = (n-d)//26 ans += chr(ord('a')+n-1) print(ans[::-1]) if __name__ == "__main__": main()
[["+", 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
90
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); Long N = sc.nextLong(); String name = ""; while (N > 0) { N = N - 1; String x = String.valueOf(Character.toChars((int)(N % 26) + 97)); name = x.co...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); Long N = sc.nextLong(); String name = ""; while (N > 0) { N = N - 1; String x = String.valueOf(Character.toChars((int)(N % 26) + 97)); name = x.co...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
130
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { long long n; cin >> n; string ans = ""; while (n > 0) { ans += 'a' + n % 26 - 1; n /= 26; } reverse(a...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { long long n; cin >> n; string ans = ""; while (n > 0) { n--; ans += 'a' + n % 26; n /= 26; } reve...
[["+", 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
87
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<int> #define vll vector<ll> #define vvi vector<vector<int>> #define vb vector<bool> #define vpli vector<pair<long long, int>> #define deb(x) cout << x << endl; ll MOD = 1e9 + 7; void solve() { ll n; cin >> n; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<int> #define vll vector<ll> #define vvi vector<vector<int>> #define vb vector<bool> #define vpli vector<pair<long long, int>> #define deb(x) cout << x << endl; ll MOD = 1e9 + 7; void solve() { ll n; cin >> n; ...
[["-", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
140
N = int(input()) ans = [] while N > 0: ans.append(chr((N % 26) + ord('a')-1)) N //= 26 print("".join(ans[::-1]))
N = int(input()) ans = [] while N > 0: N-=1 ans.append(chr((N % 26) + ord('a'))) N //= 26 print("".join(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], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
58
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { int n; cin >> n; string s = ""; while (n >= 0) { n--; s += ('a' + (n % 26)); n /= 26; } reverse(s.begin(), s.end()); cout << s; return 0; }
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { long long int n; cin >> n; string s = ""; while (n > 0) { n--; s += ('a' + (n % 26)); n /= 26; } reverse(s.begin(), s.end()); cout << s; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47]]
1
80
alpha = ['Z'] alpha.extend([chr(ord('a') + i) for i in range(26)]) N = int(input()) q = N ans = '' while True: if q <= 26: ans += str(alpha[q]) break else: q, mod = divmod(q, 26) if mod == 0: mod = 26 ans += str(alpha[mod]) print(ans[::-1])
# 自力では解けなかった(2020.7.6) alpha = ['Z'] alpha.extend([chr(ord('a') + i) for i in range(26)]) N = int(input()) q = N ans = '' while True: if q <= 26: ans += str(alpha[q]) break else: q, mod = divmod(q, 26) if mod == 0: q -= 1 mod = 26 ans += str(alpha...
[["+", 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
104
#include <bits/stdc++.h> #define rep(i, f, n) for (ll i = (f); (i) < (n); i++) #define repe(i, f, n) for (ll i = (f); (i) <= (n); i++) using namespace std; using ll = long long; ll INF = 1e+18; int main() { ll N; cin >> N; vector<char> ans; int plus = 96; while (N > 0) { int tmp = N % 26; if (tmp =...
#include <bits/stdc++.h> #define rep(i, f, n) for (ll i = (f); (i) < (n); i++) #define repe(i, f, n) for (ll i = (f); (i) <= (n); i++) using namespace std; using ll = long long; ll INF = 1e+18; int main() { ll N; cin >> N; vector<char> ans; int plus = 96; while (N > 0) { int tmp = N % 26; if (tmp =...
[["+", 10, 43, 49, 50, 51, 74, 51, 23, 0, 24], ["+", 51, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 49, 50, 51, 74, 51, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 74, 51, 23, 0, 16, 12, 13]]
1
151
n = gets.to_i str = 'abcdefghijklmnopqrstuvwxyz' result = '' while n > 0 div, mod = n.divmod(26) p [div, mod] result = str[mod - 1] + result n = (div - (mod == 0 ? 1 : 0)) end puts result
n = gets.to_i str = 'abcdefghijklmnopqrstuvwxyz' result = '' while n > 0 div, mod = n.divmod(26) result = str[mod - 1] + result n = (div - (mod == 0 ? 1 : 0)) end puts result
[["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["-", 8, 170, 0, 652, 3, 4, 0, 516, 0, 70], ["-", 8, 170, 0, 652, 3, 4, 0, 516, 0, 22], ["-", 8, 170, 0, 652, 3, 4, 0, 516, 0, 21], ["-", 8, 170, 0, 652, 3, 4, 0, 516, 0, 73]]
4
62
N = int(input()) ans = '' while N > 0: ans += chr(ord('a') + N % 26 -1) N //= 26 print(ans[::-1])
N = int(input()) ans = '' while N > 0: N -= 1#この行の意味が分からずに失敗した。今も分からない ans += chr(ord('a') + N % 26) 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
47
function main(input) { var n = input[0]; var result = ""; const abcs = "abcdefghijklmnopqrstuvwxyz"; while (0 < n) { var m = n % 26; if (m === 0) { m = 26; } result = abcs.substr(m - 1, 1) + result; n = (n - m) / 26; } console.log(result); } main(require("fs").readFileSync("/dev/st...
function main(input) { var n = parseInt(input, 10); var result = ""; const abcs = "abcdefghijklmnopqrstuvwxyz"; while (0 < n) { var m = n % 26; if (m === 0) { m = 26; } result = abcs.substr(m - 1, 1) + result; n = (n - m) / 26; } console.log(result); } main(require("fs").readFileSy...
[["+", 8, 556, 0, 198, 0, 200, 51, 2, 63, 22], ["+", 0, 198, 0, 200, 51, 2, 3, 3, 0, 24], ["-", 8, 556, 0, 198, 0, 200, 51, 69, 0, 70], ["-", 8, 556, 0, 198, 0, 200, 51, 69, 71, 555], ["-", 8, 556, 0, 198, 0, 200, 51, 69, 0, 73], ["+", 0, 198, 0, 200, 51, 2, 3, 3, 0, 21], ["+", 0, 198, 0, 200, 51, 2, 3, 3, 0, 555], ["+...
2
108
#include <stdio.h> long long int calculate(int length) { int i; long long int fans = 0, ans = 1; for (i = 1; i <= length; i++) { ans *= 26; fans += ans; } return fans; } int main(void) { long long int number, x; int length = 1, i; char *str; scanf("%lld", &number); while (number > calc...
#include <stdio.h> long long int calculate(int length) { int i; long long int fans = 0, ans = 1; for (i = 1; i <= length; i++) { ans *= 26; fans += ans; } return fans; } int main(void) { long long int number, x; int length = 1, i; char *str; scanf("%lld", &number); while (number > calc...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
0
195
// // Created by watemus on 04.07.2020. // #ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() #define FF first #define SS second using ll = long long; using ld = long double; template <typename T> using ve...
// // Created by watemus on 04.07.2020. // #ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() #define FF first #define SS second using ll = long long; using ld = long double; template <typename T> using ve...
[["+", 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
302
n=int(input()) cnt=1##文字数 tmp=26 while n>tmp: cnt+=1 tmp+=26**cnt num=n-(tmp//26) 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"] if n<=26: ans=alp[n-1] print(ans) else: ans=["0"]*cnt for i in range(cnt): j=num%26 ...
n=int(input()) cnt=1##文字数 tmp=26 while n>tmp: cnt+=1 tmp+=26**cnt num=n-(tmp//26) 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"] if n<=26: ans=alp[n-1] print(ans) else: ans=["0"]*cnt for i in range(cnt): j=num%26 ...
[["+", 0, 1, 0, 652, 3, 4, 0, 661, 0, 48], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
5
204
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin, (x).rend() typedef long long ll; int main() { ll n; cin >> n; string rta = ""; while (n > 0) { ll x = n % 26; rta += ('a' + x); n /= 26; } reverse(rta.rbegin(), rta....
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin, (x).rend() typedef long long ll; int main() { ll n; cin >> n; string rta = ""; while (n > 0) { n--; ll x = n % 26; rta += ('a' + x); n /= 26; } reverse(rta.rbegi...
[["+", 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
98
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <vector> #define REP(i, n, N) for (ll i = (n); i < (N); i++) //#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--) #define p(...
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <vector> #define REP(i, n, N) for (ll i = (n); i < (N); i++) //#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--) #define p(...
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
169
N=int(input()) keta=0 n=N ketakari=0 while(1): keta+=1 ketakari+=26**keta if N<=ketakari: break for j in range(1,keta): N-=26**j ans="" #print(keta) #print(ans) print(N) N-=1 for i in range(keta): kari=N%26 ans=chr(ord("a")+kari)+ans N//=26 print(ans)
N=int(input()) keta=0 n=N ketakari=0 while(1): keta+=1 ketakari+=26**keta if N<=ketakari: break for j in range(1,keta): N-=26**j ans="" #print(keta) #print(ans) #print(N) N-=1 for i in range(keta): kari=N%26 ans=chr(ord("a")+kari)+ans N//=26 print(ans)
[["-", 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
99
import sys input = sys.stdin.readline N = int(input()) # upper-case A-Z #[chr(i) for i in range(65,65+26)] # lower-case a-z #alphabet = [chr(i) for i in range(97,97+26)] ans = '' while N > 0: ans += chr(ord('a') + N % 26 - 1) N = N // 26 print(ans[::-1])
import sys input = sys.stdin.readline 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
62
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, \ ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, \ ...
[["+", 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], ["-", 31, 23, 0, 74, 51, 23, 0, 16, 17, 33], ["-", 31, 23, 0, 74, 51, 23, 0, 16, 12, 13]]
1
114
import java.io.*; import java.util.*; public class Main { public static void main(String[] main) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); PrintWriter out = new PrintWriter(System.out); long[] p...
import java.io.*; import java.util.*; public class Main { public static void main(String[] main) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); PrintWriter out = new PrintWriter(System.out); long[] p...
[["-", 8, 196, 0, 52, 15, 15, 0, 16, 31, 22], ["-", 8, 196, 0, 52, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 31, 22], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35], ["+", 0, 52, 8, 196, 0, 1, 0, 27, 0, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 27, 0, 68]]
3
207
#include <iostream> #include <vector> int main() { int64_t n; std::cin >> n; std::vector<char> ans; while (true) { ans.emplace_back(n % 26 - 1 + 'a'); n /= 26; if (n == 0) break; } for (auto iter = ans.rbegin(); iter != ans.rend(); ++iter) { std::cout << *iter; } std::cout << std:...
#include <iostream> #include <vector> int main() { int64_t n; std::cin >> n; std::vector<char> ans; while (true) { --n; ans.emplace_back(n % 26 + 'a'); n /= 26; if (n == 0) break; } for (auto iter = ans.rbegin(); iter != ans.rend(); ++iter) { std::cout << *iter; } std::cout <<...
[["+", 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, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
102
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { N := nextInt64() ans := "" current := N for { r:= current % 26 ans = string(r+96) + ans current = current / int64(26) if current == 0 { break } } fmt.Println(ans) } func nextInt() int { v, _ := strconv.Atoi(nextReader()) ret...
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { N := nextInt64() ans := "" current := N for { current-- r:= current % 26 ans = string(r+97) + ans current = current / int64(26) if current == 0 { break } } fmt.Println(ans) } func nextInt() int { v, _ := strconv.Atoi(nextRe...
[["+", 8, 196, 0, 7, 8, 196, 0, 462, 0, 22], ["+", 8, 196, 0, 7, 8, 196, 0, 462, 0, 68], ["+", 0, 435, 8, 196, 0, 7, 8, 196, 0, 165], ["-", 0, 16, 31, 2, 3, 4, 0, 16, 12, 433], ["+", 0, 16, 31, 2, 3, 4, 0, 16, 12, 433]]
7
505
package main import ( "bufio" "fmt" "os" ) func solve(n int64, str string) string { m := n % 26 str = string(rune('a' - 1 + m)) + str n /= 26 if n <= 0 { return str } return solve(n,str) } func main() { r := bufio.NewReader(os.Stdin) var n int64 fmt.Fscan(r, &n) str := "" str = solve(n,str) fmt....
package main import ( "bufio" "fmt" "os" ) func solve(n int64, str string) string { n-- m := n % 26 str = string(rune('a' + m)) + str n /= 26 if n <= 0 { return str } return solve(n,str) } func main() { r := bufio.NewReader(os.Stdin) var n int64 fmt.Fscan(r, &n) str := "" str = solve(n,str) fmt...
[["+", 0, 434, 0, 435, 8, 196, 0, 462, 0, 22], ["+", 0, 434, 0, 435, 8, 196, 0, 462, 0, 68], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 433]]
7
129
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, x, n) for (int i = x; i < n; i++) #define mod 1000000007 // 10^9+7 #define INF 1000000000000 // 10^12 #define F first #define S second #define P pair<int, int> #define all(vec) vec.begin()...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, x, n) for (int i = x; i < n; i++) #define mod 1000000007 // 10^9+7 #define INF 1000000000000 // 10^12 #define F first #define S second #define P pair<int, int> #define all(vec) vec.begin()...
[["+", 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
131
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) ll factorial(int i) { //階乗 if (i == 0) return 1; return (factorial(i - 1)) * i; } int main() { ll n; cin >> n; n--; string s = ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) ll factorial(int i) { //階乗 if (i == 0) return 1; return (factorial(i - 1)) * i; } int main() { ll n; cin >> n; n--; string s = ...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 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
135
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) type Io struct { reader *bufio.Reader writer *bufio.Writer tokens []string nextToken int } func NewIo() *Io { return &Io{ reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout), } } func (io *Io) Flush() { if err ...
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) type Io struct { reader *bufio.Reader writer *bufio.Writer tokens []string nextToken int } func NewIo() *Io { return &Io{ reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout), } } func (io *Io) Flush() { if err ...
[["-", 8, 196, 0, 1, 0, 2, 63, 438, 439, 22], ["-", 8, 196, 0, 1, 0, 2, 63, 438, 0, 131], ["-", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165]]
7
912
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n; cin >> n; string ans = ""; string abc = "abcdefghijklmnopqrstuvwxyz"; int rem; while (n >= 0) { n -= 1; rem = n % 26; ans += abc[rem]; n /= 26; }...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n; cin >> n; string ans = ""; string abc = "abcdefghijklmnopqrstuvwxyz"; int rem; while (n > 0) { n -= 1; rem = n % 26; ans += abc[rem]; n /= 26; } ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47]]
1
108
#include <bits/stdc++.h> using namespace std; int main() { char str[50]; long long int i = 0, n; cin >> n; while (n > 0) { int rem = n % 26; if (rem == 0) { str[i++] = 'Z'; n = (n / 26) - 1; } else { str[i++] = (rem - 1) + 'A'; n = n / 26; } } str[i] = '\0'; reverse...
#include <bits/stdc++.h> using namespace std; int main() { char str[50]; long long int i = 0, n; cin >> n; while (n > 0) { int rem = n % 26; if (rem == 0) { str[i++] = 'z'; n = (n / 26) - 1; } else { str[i++] = (rem - 1) + 'a'; n = n / 26; } } str[i] = '\0'; reverse...
[["-", 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
126
import string,sys def I(): return int(sys.stdin.readline().rstrip()) N = I() abc = string.ascii_lowercase def main(N): if N<=26: return abc[N-1] if N%26==0: return main(N//26)+abc[-1] return main(N//26)+abc[N%26-1] print(main(N))
import string,sys def I(): return int(sys.stdin.readline().rstrip()) N = I() abc = string.ascii_lowercase def main(N): if N<=26: return abc[N-1] if N%26==0: return main(N//26-1)+abc[-1] return main(N//26)+abc[N%26-1] print(main(N))
[["+", 0, 657, 31, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 12, 612]]
5
95
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { unsigned long long int N; cin >> N; string ans = ""; while (N > 0) { int tmp = N % 26; ans += (char)(tmp + 96); N /= 26; } reverse(ans.begin(), ans.end()); cout << ans << endl; }
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { unsigned long long int N; cin >> N; string ans = ""; while (N > 0) { N -= 1; int tmp = N % 26; ans += (char)(tmp + 97); N /= 26; } reverse(ans.begin(), ans.end()); cout << ans << e...
[["+", 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, 74, 51, 23, 0, 16, 12, 13], ["+", 0, 11, 12, 74, 51, 23, 0, 16, 12, 13]]
1
85
n=int(input()) l=[] while(n): n-=1 x=n%26 l.insert(0,chr(( x-1) + ord('a'))) n//=26 print("".join(l))
n=int(input()) l=[] while(n): n-=1 x=n%26 l.insert(0,chr(( x) + ord('a'))) n//=26 print("".join(l))
[["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
60
n = int(input()) ans = '' while n > 0: ans += chr(n % 26 - 1 + ord('a')) n //= 26 print(ans[::-1])
n = int(input()) ans = '' while n > 0: 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], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 12, 612]]
5
47
#include <bits/stdc++.h> using namespace std; int main() { long long num; cin >> num; string pattern = "zabcdefghijklmnopqrstuvwxy"; string name = ""; while (num != 0) { int current = num % 26; name.insert(0, 1, pattern.at(current)); if (num == 26) { break; } num /= 26; } cou...
#include <bits/stdc++.h> using namespace std; int main() { long long num; cin >> num; string pattern = "zabcdefghijklmnopqrstuvwxy"; string name = ""; while (num != 0) { int current = num % 26; name.insert(0, 1, pattern.at(current)); if (current == 0) { num--; } num /= 26; } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68]]
1
87
import sys from collections import deque sys.setrecursionlimit(10 ** 6) INF = float("inf") MOD = 10 ** 9 + 7 def input(): return sys.stdin.readline().strip() def main(): N = int(input()) alpahbet = [chr(ord("a") + i) for i in range(26)] ans = [] while N: N -= 1 ans.append(alpah...
import sys from collections import deque sys.setrecursionlimit(10 ** 6) INF = float("inf") MOD = 10 ** 9 + 7 def input(): return sys.stdin.readline().strip() def main(): N = int(input()) alpahbet = [chr(ord("a") + i) for i in range(26)] ans = [] while N: N -= 1 ans.append(alpah...
[["+", 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
125
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx") // #pragma comment(linker, "/stack:200000000"] #include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <fstream> #include <...
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx") // #pragma comment(linker, "/stack:200000000"] #include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <fstream> #include <...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
293
def C(): n = int(input()) ret = [None]*12 q = n for i in range(12): q,mod = divmod(q,26) if mod == 0: ret[i] = "z" else: ret[i] = chr(mod+96) if q == 0: break ret = ret[:i+1] ret.reverse() print("".join(map(str,ret))) C()
def C(): n = int(input()) ret = [None]*12 q = n for i in range(12): q,mod = divmod(q,26) if mod == 0: ret[i] = "z" q -= 1 else: ret[i] = chr(mod+96) if q == 0: break ret = ret[:i+1] ret.reverse() print("".join(ma...
[["+", 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
105
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (0 < N) { N--; sb.append((char)('a' + N % 26)); N /= 26; } System.out.println(sb)...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (0 < N) { N--; sb.append((char)('a' + N % 26)); N /= 26; } System.out.println(sb.revers...
[["-", 36, 36, 0, 493, 0, 454, 0, 522, 141, 22], ["+", 36, 36, 0, 493, 0, 454, 0, 525, 0, 48], ["+", 0, 1, 0, 492, 3, 4, 0, 492, 0, 131], ["+", 0, 1, 0, 492, 3, 4, 0, 492, 141, 22], ["+", 0, 492, 3, 4, 0, 492, 3, 4, 0, 24], ["+", 0, 492, 3, 4, 0, 492, 3, 4, 0, 25]]
3
92
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define endl '\n' #define loop(i, m, n) for (ll i = m; i < n; i++) #define loope(i, m, n) for (ll i = m; i <= n; i++) #define epool(i, m, n) for (ll i = m; i >= n; i--) #define mod 1000000007 #define mod2 998...
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define endl '\n' #define loop(i, m, n) for (ll i = m; i < n; i++) #define loope(i, m, n) for (ll i = m; i <= n; i++) #define epool(i, m, n) for (ll i = m; i >= n; i--) #define mod 1000000007 #define mod2 998...
[["+", 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
578
n=int(input()) alpha=[chr(i) for i in range(ord('a'),ord('z'))] ans='' while n>0: n-=1 ans=alpha[n%26]+ans n//=26 print(ans)
#171C ##One Quadrillion and One Dalmatians n=int(input()) alpha=[chr(i) for i in range(ord('a'),ord('z')+1)] ans='' while n>0: n-=1 ans=alpha[n%26]+ans n//=26 print(ans)
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
64
n = int(input()) cha = "abcdefghijklmnopqrstuvwxyz" ans = "" while n>=1: ans += cha[((n-1)%26)] n=n//26 print(ans[::-1])
n = int(input()) cha = "abcdefghijklmnopqrstuvwxyz" ans = "" while n>=1: ans += cha[((n-1)%26)] n=(n-1)//26 print(ans[::-1])
[["+", 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
51
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll num = n; string c; while (num > 0) { c.push_back(num % 26 + 'a'); num /= 26; } reverse(c.begin(), c.end()); cout << c << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll num = n; string c; while (num > 0) { num -= 1; c.push_back(num % 26 + 'a'); num /= 26; } reverse(c.begin(), c.end()); cout << c << endl; return 0; }
[["+", 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]]
1
86
#include <bits/stdc++.h> #include <math.h> #include <string> #include <unordered_map> #define ll long long using namespace std; const ll INF = 1LL << 60; const int inf = 1 << 30; const ll N = 1e10; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int cnt[10000001]; int main() { ll ...
#include <bits/stdc++.h> #include <math.h> #include <string> #include <unordered_map> #define ll long long using namespace std; const ll INF = 1LL << 60; const int inf = 1 << 30; const ll N = 1e10; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int cnt[10000001]; int main() { ll ...
[["+", 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
133
x = int(input()) def converter(x): if x <= 26: y = chr(x + 96) elif x % 26 == 0: y = converter(x // 26) + chr(122) else: y = converter(x // 26) + chr(x % 26 + 96) return y name = converter(x) print(name)
x = int(input()) def converter(x): if x <= 26: y = chr(x + 96) elif x % 26 == 0: y = converter(x // 26 - 1) + chr(122) else: y = converter(x // 26) + chr(x % 26 + 96) return y name = converter(x) print(name)
[["+", 12, 657, 31, 652, 3, 4, 0, 657, 17, 33], ["+", 12, 657, 31, 652, 3, 4, 0, 657, 12, 612]]
5
78
n = int(input()) tmp = 0 i = -1 tmp_list= [] while tmp<=n: i+=1 tmp+=26**i tmp_list.append(26**i) n-=tmp-tmp_list[-1] tmp = [] while 1: if n<=26: tmp.append(n%26) break tmp.append(n%26) n = n//26 alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",...
n = int(input()) tmp = 0 i = -1 tmp_list= [] while tmp<=n: i+=1 tmp+=26**i tmp_list.append(26**i) n-=(tmp-tmp_list[-1]) tmp = [] while 1: if n<26: tmp.append(n%26) break tmp.append(n%26) n = n//26 alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",...
[["+", 0, 656, 0, 1, 0, 677, 12, 23, 0, 24], ["+", 0, 656, 0, 1, 0, 677, 12, 23, 0, 25], ["-", 0, 52, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 667, 18]]
5
232
def main(): N = int(input()) - 1 digits = [] while True: a, b = N // 26, N % 26 digits.append(b) if a == 0: break N = a digits.reverse() chars = map(to_alphabet, digits) print(''.join(chars)) def to_alphabet(x: int): return chr(65 + x).lower() ...
def main(): N = int(input()) - 1 digits = [] while True: a, b = N // 26, N % 26 digits.append(b) if a == 0: break N = a - 1 digits.reverse() chars = map(to_alphabet, digits) print(''.join(chars)) def to_alphabet(x: int): return chr(65 + x).lowe...
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
100
#include <iostream> #define ll long long using namespace std; int main() { ll n; cin >> n; string s = ""; while (n > 0) { s = (char)((n - 1) % 26LL + 'a') + s; n /= 26; } cout << s; }
#include <iostream> #define ll long long using namespace std; int main() { ll n; cin >> n; string s = ""; while (n > 0) { s = (char)((n - 1) % 26LL + 'a') + s; n -= 1; n /= 26; } cout << s; }
[["+", 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]]
1
65
#include <bits/stdc++.h> #define fast \ std::ios::sync_with_stdio(false); \ cin.tie(NULL); #define int long long #define all(c) (c).begin(), (c).end() #define endl '\n' using namespace std; // ...
#include <bits/stdc++.h> #define fast \ std::ios::sync_with_stdio(false); \ cin.tie(NULL); #define int long long #define all(c) (c).begin(), (c).end() #define endl '\n' using namespace std; // ...
[["+", 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
143
n = int(input()) s='' while n!=0: tmp=n%26 s=chr(96+tmp)+s n//=26 print(s)
n = int(input()) s='' while n!=0: n-=1 tmp=n%26 s=chr(96+tmp+1)+s n//=26 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], ["+", 12, 657, 31, 652, 3, 4, 0, 657, 17, 72], ["+", 12, 657, 31, 652, 3, 4, 0, 657, 12, 612]]
5
39
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repit(itr, x) for (auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr, x) for (auto ritr = x....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repit(itr, x) for (auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr, x) for (auto ritr = x....
[["+", 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
138
def A(x): if ord(x) - ord('a') >= 0: print('a') else: print('A') def B(n, k, p_list): p_list = sorted(p_list) print(sum(p_list[:k])) def C(N): for i in range(99): if N < 26**i: ans = [] for j in range(i): ans += chr(ord('a') + N % 26) N //= 26 return ''.join(a...
def A(x): if ord(x) - ord('a') >= 0: print('a') else: print('A') def B(n, k, p_list): p_list = sorted(p_list) print(sum(p_list[:k])) def C(N): for i in range(99): if N < 26**i: ans = [] for j in range(i): ans += chr(ord('a') + N % 26) N //= 26 return ''.join(a...
[["+", 0, 37, 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, 37, 0, 652, 3, 4, 0, 206, 0, 73]]
5
166