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 | n=int(input())
s=''
while n:
n-=1
s=chr(97+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 | 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<iostream>
using namespace std;
int main(){
string s;
long long n;
cin>>n;
while(n--){
s=char(97+n%26)+s;
n/=26;
}
cout<<s;
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;
typedef long long ll;
int main(){
ll n;
cin>>n;
string s="";
while(n--){
s=char(n%26+'a')+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 | #include <bits/stdc++.h>
using namespace std;
long long n;
string s;
int main(){
cin>>n;
s="";
while(n--){
s=s+char(n%26+'a');
n/=26;
}
reverse(s.begin(),s.end());
cout<<s;
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()
{
unsigned long long int n;
cin>>n;
--n;
string s="";
while(n >= 26) {
s+=char((n%26) + 'a');
n/=26;
--n;
}
s+=char(n+'a');
reverse(s.begin(),s.end());
cout<<s;
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.io.*;
import java.util.*;
class Main
{
public static void main(String args[])throws Exception
{
BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
char al[]=new char[27];
int i;
for(i=1;i<=26;i++)
... | 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;
#define int long long
signed main()
{
int n,k;
string ans="";
cin>>n;
while(n)
{
k=n%26;
if(!k)
{
k=26;
n--;
}
ans=(char)('a'+k-1)+ans;
n/=26;
}
cout<<ans;
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())
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 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
// 文字列の長さを求める
long[] max = new long[12];
int l = 1;
max[l] = 26;
while(N > max[l]) {
l++;
max[l] = (max[l - 1] + 1) * 26;
}
// l桁の範囲で、元の数字をa~zを0~25の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())
str=''
while True:
N-=1
str=chr(N%26+ord('a'))+str
N//=26
if N<=0:break
print(str)
| 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m = 26;
cin >> n;
string s = "";
while(n > 0) {
int mod = (n-1) % 26;
s = " " + s;
s[0] = ('a' + mod);
n = (n-1) / m;
}
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 | import java.util.*;
public class Main {
public static void main(String[] args) {
//1_000_000_000_000_001 15
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
StringBuilder sb = new StringBuilder();
boolean exit = false;
while(!exit){
... | 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;
using ll=long long;
int main(){
ll n;
cin>>n;
string s;
while(n){
n--;
ll tmp=n%26;
s.push_back(tmp+'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 | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
long long n;
cin>>n;
while (n--){
s=char(97+n%26)+s;
n/=26;
}
cout<<s;
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.*;
import java.math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
int ASC = 96;
List<Character> name = new ArrayList<>();
while (N > 0) {
if (N%26==0)
{name.add('z');}
else {name.add((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())
dog=""
while N>0:
N-=1
dog+=chr(ord('a')+N%26)
N//=26
print(dog[::-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;
string s="abcdefghijklmnopqrstuvwxyz";
int main(){
long long n;
cin>>n;
string ans;
while(n){
n--;
ans+=s[n%26];
n/=26;
}
reverse(ans.begin(),ans.end());
cout<<ans;
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.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
sc.close();
StringBuilder sb = new StringBuilder();
while (n > 0) {
n -= 1;
sb.append((char) ('a' + n % 26));
n /= 26;
}
S... | 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;
string s="";
cin>>n;
while(n--)
{
s=s+char(n%26+'a');
n/=26;
}
reverse(s.begin(),s.end());
cout<<s;
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 | MOD=10**9+1
n=int(input())
ans=''
while n:
ans=chr(ord('a')+(n+25)%26)+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<bits/stdc++.h>
int main()
{
long long N;
std::cin >> N;
std::string ans;
ans = "";
while(N)
{
N--;
ans = char(N%26 + 'a') + ans;
N /= 26;
}
std::cout << ans << std::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())
S = ''
while N:
N -= 1
S += (chr(N%26+ord('a')))
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 | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
long long n;
cin>>n;
while(n>0){
n-=1;
s+=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.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter ... | 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;
cin>>s;
while(n){
n-=1;
s+=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 | #include <bits/stdc++.h>
using namespace std;
string rec(long long N) {
if (N == 0) return "";
N--;
return rec(N/26) + string(1, 'a' + N%26);
}
int main()
{
long long N; cin >> N;
cout << rec(N) << 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;
using ll = long long;
int main() {
ll n;
cin >> n;
string ans;
while (n > 0) {
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 | N = int(input())
ans = ''
while(N > 0):
N -= 1
_i = N % 26
ans = chr(ord('a') + _i) + 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 | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
StringBuilder ans = new StringBuilder();
while(N > 0){
N--;
ans.append((char) (N % 26 + 'a'));
N /= 26;
}
System.out.println(ans.revers... | 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>
#include<algorithm>
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;
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 s = new Scanner(System.in);
long n = s.nextLong();
int rem=0;
String name = "";
char c;
while(n>0) {
rem =(int) ((n-1) % 26);
c = (char)('a'+rem);
... | 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 | def f(n):
if n == 0:
return ""
n-=1
return f(n//26) + chr(97 + n%26)
n = int(input())
print(f(n)) | 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 String getKey(Long index){
String colCode = "";
char key='a';
Long loop = index / 26;
if(loop>0){
colCode += getKey(loop-1);
}
key = (char) (key+index%26);
colCode += key;
return colCode;
}
public static void main(String[] args) {
... | 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 > 0:
N -= 1
r = N % 26
res = chr(r + 97) + res
N //= 26
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())
s='abcdefghijklmnopqrstuvwxyz'
ans=''
while n > 0:
n=n-1
ans+=s[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 | import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args) throws Exception
{
Scanner sc=new Scanner(System.in);
Long n=sc.nextLong();
List<Long> li=new ArrayList<Long>();
Quadrillion(n);
}
public static void Quadrillion(Long n)
{
StringBuffer sb=new StringBuff... | 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 = ""
d = 26
while N :
N-=1
c = N% 26
res += chr(97+c)
N //=26
print(res[::-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 scanner = new Scanner(System.in);
long N = Long.parseLong(scanner.nextLine());
String name = "";
name = calc(N, name);
System.out.println(name);
scanner.close();
return;
}
public static String... | 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.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
char[] c = {'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'};
StringB... | 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().strip())
ans = ''
while N > 0:
ans = chr(ord('a') + (N-1) % 26) + 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 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
long n = s.nextLong();
int ctr = 0;
long num = 0;
while(n>num*26+26) {
num = num*26+26;
ctr++;
}
n = n-num-1;
while(ctr>=0) {
long ans = (long)(Math.pow(26, ctr))... | 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 | from math import log, ceil
r = 26
ab = "abcdefghijklmnopqrstuvwxyz"
input = raw_input
n = int(input())
def answer(n):
m = int(ceil(log(n*(r-1) + r, r))) - 1
#cur = r ** (m-1)
out = ""
sub = (r ** m - r) // (r-1)
n = n - sub - 1
for i in range(m):
i = n % r
out = ab[i] + out
... | 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 | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
String[] a = new String[]{"z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
ArrayList<String> g =... | 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.*;
import java.math.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long N = input.nextLong();
String ans = "";
Stack<Character> seq = new Stack<Character>();
while (N>0) {
N--;
char cur = (char)(N%26+97);
s... | 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);
final long N = sc.nextLong() - 1;
final int NUM = 26;
StringBuilder str = new StringBuilder();
str.append((char) ('a' + N % NUM)... | 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())
a=''
while n != 0:
n-=1
a=chr(int(97+n%26))+a
n//=26
print(a) | 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())
res = ""
while n > 0:
n, rem = divmod(n - 1, 26)
res = chr(97 + rem) + res
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n; cin >> n;
string s = "";
while(n > 0){
n -= 1;
s += 'a' + n%26;
n = 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):
n-=1
x=n%26
l.insert(0,chr(( x) + ord('a')))
n//=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 | n=int(input())
# n-=1
r=[]
while n:
n-=1
r.append(chr(ord('a')+n%26))
n//=26
print(*r[::-1],sep='') | 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>
using namespace std;
int main(){
long long int n;
cin>>n;
string ans="";
while(n>0){
ans+=((n-1)%26)+'a';
n=(n-1)/26;
}
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 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
PrintWriter out... | 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 | a=int(input())
name=""
while a>0:
a-=1
name+=chr(97+a%26)
a//=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 <iostream>
#include <string>
using namespace std;
int main (){
long x;
cin >>x;
string kq;
long n=0;
while (x){
x-=1;
kq += 'a' + x%26;
x/=26;
n++;
}
for (int i=n-1; i>=0; i--){
cout <<kq[i];
}
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())
ans = ""
while N > 0:
N -=1
ans = chr(ord("a") + (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;
long long n;
string a,b;
char c;
int main()
{
cin>>n;
do{
c=(n-1)%26+'a';
a+=c;
n=(n-1)/26;
}while(n>0);
for(int i=a.size()-1;i>=0;i--)b+=a[i];
cout<<b;
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.io.*;
import java.util.*;
public class Main{
public static void main(String args[]) throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
long N= Long.parseLong(reader.readLine());
String res = "";
while(N>0){
N--;
res = (char)('a'+ 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.Scanner;
class Main {
static char[] alphabet = "abcdefghijklmnopqrstuvwxyz".toCharArray();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long tmp = n;
int keta = 1;
while (true) {
tm... | 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) throws Exception {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
int aPos = ('a');
StringBuilder res = new StringBuilder();
while (N != 0) {
if (N % 26 == 0) {
res.insert(0, 'z');
N--;
} 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 | import sys
if sys.subversion[0] == "PyPy":
import io, atexit
sys.stdout = io.BytesIO()
atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))
sys.stdin = io.BytesIO(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())... | 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 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
long n = sc.nextLong();
StringBuilder result = new StringBuilder();
long tmp = 0;
do {
n -= 1;
tmp = n % 26;
result.append((char)('a' + tmp));
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>0:
N -= 1
ans = chr(N%26+97) + ans
N = 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;
using ll = long long;
int main(){
ll 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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t N;cin>>N;
string S="";
while(N--){
S = char('a' + N % 26) + S;
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())
keta=1
a=26
ans=""
while N>0:
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 | import java.util.Scanner;
public class Main {
public static void main(String... args) throws Exception {
try (Scanner scn = new Scanner(System.in)){
System.out.println(to26Str(scn.nextLong()));
}
/*
for(int i=17576; i<=(17576) + 26*26 + 26*2; i++) {
System.out.println(i + ": " + to26Str(i));
}
*/
... | 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.BigInteger;
public class Main {
public static void main(String[] args) {
var sc = new java.util.Scanner(System.in);
var n = sc.nextBigInteger();
var output = "";
for(;n.compareTo(BigInteger.valueOf(26))>0;) {
var mod = n.subtract(BigInteger.ONE).mod(BigInteger.valueOf(26));
output = Cha... | 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(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 | import java.lang.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String str = scan.next();
long num = Long.parseLong(str);
num--;
ArrayList<Long> list = new ArrayList<>();
while (true) {
... | 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;
typedef long long ll;
ll n;
string ans;
int main(){
cin>>n;
while(n){
n-=1;
ans+=n%26+'a';
n/=26;
}
for(int i=ans.size()-1;i>=0;i--) cout<<ans[i];
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())
res = ''
while n > 0:
n-=1
res='abcdefghijklmnopqrstuvwxyz'[n%26]+res
n=n//26
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 | #include <bits/stdc++.h>
using namespace std;
long long n;
string s,t;
char c;
int main()
{
cin>>n;
do
{
c=(n-1)%26+'a';
s+=c;
n=(n-1)/26;
}
while(n>0);
for(int i=s.size()-1;i>=0;i--)t+=s[i];
cout<<t;
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.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
try(var br = new BufferedReader(new InputStreamReader(System.in))) {
var input = Long.parseLong(br.readLine());
var result = ... | 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;
#define ll long long
int main(){
ll n;
cin>>n;
string s;
while(n!=0){
n--;
s+='a'+n%26;
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 | import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
resolve(System.in, System.out);
}
static void resolve(InputStream is, PrintStream pw) {
Scanner sc = new Scanner(is);
long n = Long.parseLong(sc.next());
... | 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>
#include <string>
using namespace std;
int main(){
long long n;
cin>>n;
string a;
while(n>0){
n--;
a+= char(int('a')+n%26);
n/=26;
}
for(int i=a.size()-1;i<a.size();i--) cout<<a[i];
} | 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 ans;
while(n) {
n--;
ans = string(1, 'a' + n % 26) + ans;
n /= 26;
}
cout << ans;
} | 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 | // C - One Quadrillion and One Dalmatians
#include <bits/stdc++.h>
using namespace std;
int main(){
int64_t n; cin>>n;
string ans = "";
while(n){
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t N;
cin>>N;
string al="abcdefghijklmnopqrstuvwxyz";
string t;
while(N>0){
--N;
int q=N%26;
t=al[q]+t;
N=(N-q)/26;
}
cout<<t<<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-=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 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long x = in.nextLong();
System.out.println(asd(x - 1));
}
public static String asd(long i) {
if (i < 0) {
return "-" + asd(-i - 1);
... | 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 n = sc.nextLong();
StringBuilder ans = new StringBuilder();
while(0 < n) {
n--;
ans.append((char) (n % 26 + 97));
n /= 26;
}
System.out.println(ans.reverse());
s... | 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--) {
s = char(n % 26 + 'a') + 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 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n;
string s="";
cin>>n;
while(n--){
s=char(n%26+'a')+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 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin >> n;
string ans = "";
while(n){
n--;
ans += (char)('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 | n = int(input())
s=''
while n!=0:
n-=1
tmp=n%26
s=chr(96+tmp+1)+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 | N=int(input())
a=26
ans=''
while N>0:
N-=1
ans+=chr(ord('a')+N%a)
N//=a
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 res;
long long n;
cin>>n;
res = "";
while (n > 0)
{
n --;
res = char('a' + n % 26) + res;
n /= 26;
}
cout<<res<<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())
s = ""
while n > 0:
n -= 1
s += chr(ord("a")+n%26)
n //= 26
s = s[::-1]
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.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
String ans="";
char c[]=new char[12];
int q=0;
while(n>0) {
n--;
c[q++]=(char)(n%26+'a');
n/=26;
}
for(int i=q-1;... | 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())
t = ""
while N > 0:
t += chr((N-1)%26 + 97)
N = (N-1)//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()
{
long long n;
cin>>n;
vector<char>v;
while(n)
{
n--;
v.push_back(n%26+'a');
n/=26;
}
reverse(v.begin(),v.end());
for(char c:v)
cout<<c;
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 = Long.parseLong(sc.next());
String ans = "";
while(n != 0) {
char tmp;
if(n%26 == 0) {
tmp = 'z';
n = n/26 -1;
}else {
tmp = (char) (n%26 +96);
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())
s = ""
while n > 0:
div = (n-1) % 26
s = chr(div + 97) + s
n = (n-div-1) // 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 | n = int(input())
ans = str()
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 | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
char[] ch = "abcdefghijklmnopqrstuvwxyz".toCharArray();
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
StringBuilder sb = new S... | 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) {
Main m=new Main();
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
String value="";
String val="";
while(n>0){
long rem=n % 26;
if(rem==0){
val="Z";
value=val+value;
... | 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)
n //= 26
ans = ans[::-1]
print(ans) | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.