Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; class Main{ public static void main(String args[]){ Scanner s=new Scanner(System.in); long N=s.nextLong(); String ans=""; for(;0<N;){ char c=(char)((N-1)%26+97); ans=String.valueOf(c)+ans; N=(N-1)/26; } System.out.println(ans); } }
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin>>n; string s=""; while(n){ n--; s+='a'+(n%26); n/=26; } reverse(s.begin(),s.end()); cout<<s<<"\n"; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { uint64_t n; cin >> n; string ans; while (n > 0) { n--; ans.insert(0, 1, 'a' + n % 26); n /= 26; } cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long number = scanner.nextLong(); String result = new String(); while(number > 0) { int nums = (int) ('a' + (number - 1) % 26); char temporal = (char) nums; result = tem...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.math.BigDecimal; import java.util.*; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().run(); } void run() { long n = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (n != 0) { ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); System.out.println(base26(n)); } static String base26(long n) { StringBuilder buf = new StringBuilder(); while (n != 0) { ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long pre_total = 0; long total = 0; int mojisuu = 0; long n = sc.nextLong(); StringBuilder val = new StringBuilder(); while(n>0){ val.append(alpha((int)((n-1)%26))...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(raw_input()) N -= 1 alphabet = 'abcdefghijklmnopqrstuvwxyz' p = 26 while N >= p: N -= p p *= 26 p /= 26 answer = '' while p >= 1: answer += alphabet[N/p] N %= p p /= 26 print answer
PYTHON
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) t = '' while n > 0: n -= 1 t+=(chr(97 + n%26)) n//=26 print(t[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; string name ="";//英小文字 while(n) { n--; name += (char)('a' + n % 26LL); n /= 26LL; } reverse(name.begin(), name.end()); cout << name; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; string ans; while(N) { N--; ans += 'a' + N % 26; N /= 26; } reverse(ans.begin(), ans.end()); cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import static java.lang.Long.parseLong; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = parseLong(sc.next()) - 1; StringBuilder sb = new StringBuilder(); while (n >= 26) { sb.insert(0, (char) ('a' + n % 26)); ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan=new Scanner(System.in); long n=scan.nextLong(); ArrayList<Character> al=new ArrayList<Character>(); while(n>0) { long x=(n-1)%26; al.add((char) ('a'+x)); n=(n-1)/26; } ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) s = "" while n > 0: n -= 1 s = chr(ord('a') + (n%26)) + s n //= 26 print(s)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; #define ll long long int32_t main(){ ll n; cin>>n; string ans=""; for(;n>0;n/=26){ n--; ans+=n%26+'a'; } reverse(ans.begin(), ans.end()); cout<<ans<<endl; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n=int(input()) b="" while n>0: n-=1 b+=chr(ord("a")+n%26) n=n//26 print(b[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long index[] = new long[100]; index[0] = 1; for (int i = 1; i < 11; i++) { index[i] = index[i-1] + (long...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ long long int n,temp; cin>>n; temp=n; int dig; string s=""; while(n) { n=n-1; char a=(char)'a'+n%26; s=a+s; n=n/26; } cout<<s<<"\n"; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main() { long long n; string res; cin>>n; while(n) { if(n%26==0) { res='z'+res; n=n-26; } else res=char('a'-1+n%26)+res; n=n/26; } cout<<res; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.math.BigInteger; import java.nio.Buffer; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; import java.util.Vector; public class Main { public static Scanner r=new Scanner(System.in); public static void main(String[] args) { long n; n=r.nextLong(); ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n;cin>>n; string str; while(n!=0){ int x=(n-1)%26; char ch='a'+x; str=ch+str; n=(n-1)/26; } cout<<str; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; long long N; int main(){ cin>>N; string s=""; while(N>0){ long long plus=97; long long tmp=(N-1)%26; char temp=plus+tmp; s=temp+s; N=(N-1)/26; } cout<<s<<'\n'; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { public static void main(String[] args) { // write your code here Scanner sc = new Scanner(System.in); long inu = sc.nextLong(); StringBuilder sb = new StringBuilder(); while (inu > 0) { inu -= 1; long a = inu % 26; ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) - 1 rlt = "" while N > -1: rlt = chr(ord("a")+N%26) + rlt N = N//26 - 1 print(rlt)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; string ans; while (N--) ans = char('a' + N % 26) + ans, N /= 26; cout << ans << "\n"; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); String str = "abcdefghijklmnopqrstuvwxyz"; StringBuilder sb = new StringBuilder(); int len = 1; for(int i=1; i<16; i++){ if(Math.pow(26,i) < n){ len++; n...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; long long n; string ans=""; int main(){ cin >> n; while (n>0){ ans.push_back(((n-1)%26)+'a'); n--; n/=26; } reverse(ans.begin(),ans.end()); cout << ans << "\n"; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) S = "" while N > 0: N -= 1 S += chr(ord('a') + N % 26) N //= 26 print(S[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = "" while n != 0: n -= 1 ans += chr(ord('a') + n%26) n //= 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) name = "" while n > 0: n -= 1 name += chr(ord('a') + n%26) n = n // 26 print(name[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n=sc.nextLong(),m=n; StringBuffer sb=new StringBuffer(); while(n>0){ long f=n%26; if(f==0){ sb.append('z'); n=n/26-1; }else{ ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N=int(input()) res="" while(N): N-=1 res=res+chr(ord("a")+int(N%26)) N=int(N/26) res=res[::-1] print(res)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) Ans = [] while N > 0: N -= 1 Ans.append(chr(97 + N % 26)) N //= 26 print(''.join(Ans[::-1]))
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; /** * 解题方法 26 进制 * k 进制每一位最大只有 k - 1,但是此道题目最大可以是 26,所以每次处理 N - 1 */ public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long N = scanner.nextLong(); String ans = ""; while (N > 0) { N--; ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N=int(input()) ans='' while N>0: N-=1 ans+=chr(97+N%26) N//=26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { string an=""; long long n; cin >> n; while(n>0){ n-=1; an +='a'+n%26; n/=26; } reverse(an.begin(),an.end()); cout << an; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
s=int(input())-1 d=[] while s>=0: d.append(chr(s%26+97)) s//=26 s-=1 t='' for i in reversed(d): t+=i print(t)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin>>n; string s; while(n){ n=n-1; s = s + char('a' + n % 26); n /= 26; } reverse(s.begin(),s.end()); cout<<s; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { static public void main(String args[]){ Scanner sc=new Scanner(System.in); Long nu=sc.nextLong(); String str="abcdefghijklmnopqrstuvwxyz"; List<String>list=new ArrayList<>(); do{ nu--; String s=Long.toString(nu%26); //System.out.print(s); list.ad...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using ll = long long; using namespace std; void solve(ll n) { if (n < 26) putchar(n + 'a'); else { solve(n / 26 - 1); putchar(n % 26 + 'a'); } } int main() { ll n; cin >> n; solve(n - 1); }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); string s; long long n; cin>>n; while(n--) { s=char(97+n%26)+s; n/=26; } cout<<s<<endl; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
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 (N > 0) { N = N - 1; long r = N % 26; sb.append((char)('a' + r)); N = N / 26; } // 結...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) ans = '' while(N): N -= 1 ans+=chr(ord('a')+N % 26) N //= 26 print (ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; typedef long long ll; string f(ll 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) << "\n"; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; long long n; void solve(long long x){ if(!x)return; if(x%26)solve(x/26);else solve(x/26-1); putchar((char)((x-1ll)%26ll+97)); } int main(){ scanf("%lld",&n);solve(n); }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { // 1,000,000,000,000,001 Scanner sc = new Scanner(System.in); long n = sc.nextLong(); sc.close(); List<String> list...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main() { { long long n; cin>>n; string s = ""; while (n --> 0){ s += char((n%26) + 'a'); n/=26; } reverse(s.begin(), s.end()); cout << s; } }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); System.out.println(toAlphabet(N)); } public static String toAlphabet(long num){ if (num <= 0) return ""; long n = num % 26; n = (n == 0) ? 26 : n; char ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = '' while n: n -= 1 ans += chr(ord('a') + n % 26) n //= 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) ans = "" while N > 0: N -= 1 ans += chr(ord('a') + N % 26) N //= 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = "" while n: n -= 1 ans += chr(n % 26 + ord('a')) n //= 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { public static void main(String args[]) { Scanner scn = new Scanner(System.in); long n = scn.nextLong(); String s = "abcdefghijklmnopqrstuvwxyz"; String ans = ""; n = n - 1; int a; char c; while (n / 26!=0) { ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N=int(input()) S="" while N: N-=1 S+=chr(ord("a")+N%26) N//=26 print(S[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()); ans = ''; ptr = 0; while(n>0): n-=1; temp = n%26; n=n//26; ans = chr(97+temp)+ ans print(ans)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<cstdio> #define ll long long ll n; int s[10000],_s; int main(){ scanf("%lld",&n); while(n){ if(n%26) s[++_s]=n%26; else{ s[++_s]=26; n-=26; } n/=26; } for(int i=_s;i;i--) putchar(s[i]+'a'-1); }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n;cin>>n; string s; while(n>0){ n--; s+=('a'+n%26); n=n/26; } reverse(s.begin(),s.end()); cout<<s<<endl; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
a = '' n = int(input()) while n> 0: n -= 1 a += chr(ord('a') + n%26) n //=26 print(a[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N=int(input()) ans="" while N>0: tmp=(N-1)%26 ans=chr(int(tmp)+97)+ans N=int((N-tmp)/26) print(ans)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); long N =sc.nextLong(); long M; int m; int x=0; String ans1 ="0"; String T[] ={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = "" while n: n -= 1 ans = chr(97 + n % 26) + ans n //= 26 print(ans)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int64_t n; cin >>n; string ans = ""; while(n--){ ans+=(char)(n%26+'a'); n /= 26; } reverse(ans.begin(),ans.end()); cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans ='' while n > 0: n = n - 1 ans += chr(ord('a') + n % 26) n = n // 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ long long N; cin >> N; string S=""; while(N){ N--; char C='a'+N%26; S.push_back(C); N/=26; } reverse(S.begin(),S.end()); cout << S << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ long n; cin >> n; string ans = ""; while(n>0){ n--; char tmp = n%26 + 'a'; ans = tmp + ans; n /= 26; } cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; string func(long long N) { if (N == 0) return ""; N--; return func(N / 26) + string(1, 'a' + (N % 26)); } int main() { long long N; cin >> N; cout << func(N) << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin>>n; if(n%26==0) { } string s=""; while(n>0) { n--; s+='a'+n%26; n/=26; } reverse(s.begin(),s.end()); cout<<s; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<iostream> #include<string> using namespace std; int main(){ long long n;cin>>n; string ans; while(n>0){ n--; ans=(char)('a'+n%26)+ans; n=n/26; } cout<<ans<<endl; return 0; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; string ans; while (N > 0) { N--; ans = char ('a' + (N % 26)) + ans; N /= 26; } cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; import java.io.*; class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); long c=sc.nextLong(); String[] letter = {"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"}; long i=0; int j=0; String str="...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<bits/stdc++.h> using namespace std; int main() { string s; long n; cin>>n; while(n--) { s=char(97+n%26)+s; n/=26; } cout<<s; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; class Main { public static void main(String[] args) throws Exception{ Scanner sc = new Scanner(System.in); long N=sc.nextLong(); sc.close(); String t=""; while(N>0){ N--; t+=(char)('a'+N%26); N/=26; } for(int i=t.length()-1;i>=0;i--) { System.out.print(t.ch...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = '' while n > 0: n -= 1 ans = chr(n % 26 + 97) + ans n //= 26 print(ans)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n,k,sum=0; cin>>n; string s=""; while(n){ n--; ll rem=n%26; s=char('a'+rem)+s; n=n/26; } cout<<s<<endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n=int(input()) l=[] while(n!=0): n=n-1 l.append(chr(ord('a')+(n%26))) n=int(n/26) l=l[::-1] print("".join(l))
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); long N=sc.nextLong(); int maxlen=12; long[] space=new long[maxlen]; space[0]=1; int ketasu=0; String ans=""; for(int i=1; i<maxlen; i++) { space[i]=space[i-1]*26; } for(int i=1; i<m...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = '' while n > 0: n -= 1 ans += chr(n % 26 + ord('a')) n //= 26 print(ans[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n=int(input()) d='abcdefghijklmnopqrstuvwxyz' x=n s='' n-=1 while(n>=0): s+=d[n%26] n=n//26 n-=1 print(s[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); int k = 1; long z = 26L; long d = 0L; while ( z < n ) { d = z; k++; z += (long)Math.pow(26, k); } long y = n - d - 1L; String alp = "abcdefghijklmno...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); long n = scn.nextLong(); fun(n); } public static void fun(long n) { if(n<27) { System.out.print((char)(n+96)); return; }else if(n<703) { if(n%26!=0) { System.out.print((char)(n...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
public class Main { static char[] arr = ("abcdefghijklmnopqrstuvwxyz").toCharArray(); public static void main(String[] args){ long N = new java.util.Scanner(System.in).nextLong(); System.out.println(getName(N, "")); } private static String getName(long n, String str) { long syo = n / 26L;...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) al = 'abcdefghijklmnopqrstuvwxyz' s = '' while n: n -= 1 e = n % 26 s = al[e] + s n //= 26 print(s)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { var sc = new Scanner(System.in); var n = sc.nextLong(); sc.close(); var sb = new StringBuilder(); while (n > 0) { sb.append((char) ('a' + ((n - 1) % 26))); n = (n - 1) / 26; } sb.reverse(); System.out.println...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.io.BufferedInputStream; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(new BufferedInputStream(System.in)); long a=sc.nextLong(); long c=a-1; String m=""; while (a != 0&&c>=0) { ch...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long l = sc.nextLong(); String ret = ""; while(true) { l--; int c = (int)(l%26); char x = (char)('a' + c); ret = String.valueOf(x) + ret; l /= 26; if ( l =...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; string S; while (N--) S = char('a' + N % 26) + S, N /= 26; cout << S << "\n"; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long long n; scanf("%lld", &n); string res = ""; while (n > 0) { n--; res += (n % 26) + 'a'; n /= 26; } reverse(res.begin(), res.end()); cout << res << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
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(n > 0) { n--; sb.append((char)( 'a' + n % 26 ) ); // sb.append((char)( 97 + n % 26 ) ); n = n / 26; ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) name = '' while N > 0: name += chr(ord('a') + (N - 1) % 26) N = (N - 1) // 26 print(name[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; string s=""; while(n>0){ n--; char a=n%26+'a'; s+=a; n/=26; } reverse(s.begin(),s.end()); cout << s << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
N = int(input()) l = "" while N > 0: N -= 1 l += chr(ord("a") + N % 26) N //= 26 print(l[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n=int(input()) out="" n=n-1 while n>=0 : out+=chr(ord("a")+n%26) n=n//26-1 print(out[::-1])
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <bits/stdc++.h> using namespace std; int main() { long int N; string s; cin>>N; while(N){ s.insert(s.begin(),(N+25)%26+97); N=(N-1)/26; } cout<<s<<endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
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(); int i = 1; while (i <= 11) { if (n > Math.pow(26, i)) { n ...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
import java.util.*; import java.io.*; public class Main { public static void main(String ars[])throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw=new PrintWriter(System.out); //String str[]=br.readLine().split(" "); long n=Lo...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include<iostream> using namespace std; int main() { string ans; int64_t N; cin >> N; while (N--) { ans = (char)(N % 26 + 'a') + ans; N /= 26; } cout << ans << endl; }
CPP
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n=int(input()) l=[] while n>0: r=(n-1)%26+1 l.insert(0,chr(ord('a')+r-1)) n=(n-1)//26 print(''.join(l))
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
//package com.company; import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); StringBuilder ans=new StringBuilder(); long n=sc.nextLong(); while(n>0){ n--; ans.append((char) ((n % 26) + 'a'...
JAVA
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
n = int(input()) ans = '' while n: ans = chr((n-1)%26+ord('a')) + ans n = (n-1) // 26 print(ans)
PYTHON3
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
6
0
#include <iostream> #include<algorithm> #include<cstring> 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; }
CPP