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 | #include <bits/stdc++.h>
using namespace std;
int main(){
long n;
cin >> n;
string s;
while(n>0){
n--;
s += char(n%26+97);
n = (n-n%26)/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())
result=''
while n>0:
n-=1
result+=chr(ord('a')+n%26)
n//=26
print(result[::-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())
z=""
while n>0:
n=n-1 ##for tracking last character
z+= chr( n%26 + ord('a') )
n=n//26
print(z[::-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--) {
s = (char)('a' + (int)(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;
int main() {
long long int n;
cin>>n;
string s;
while (n){
s+='a'+(n-1)%26;
n=(n-1)/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 {
public static void main(String[] args) {
try (Scanner s = new Scanner(System.in)) {
long n = s.nextLong();
StringBuilder sb = new StringBuilder();
while (n > 0) {
n--;
long r = 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
string ans;
while(N>0){
N--;
ans += (N%26)+'a';
N/=26;
}
reverse(ans.begin(),ans.end());
cout << ans << endl;
}
| 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 num = sc.nextLong();
System.out.print(read(num));
}
private static String read(long num) {
if(num<=26) {
char c = (char)(num+96);
... | 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=str()
while(n>0):
n=n-1
k=n%26
ans=chr(ord('a')+k)+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 <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
string f(ll n)
{
if(n==0)
{
return " ";
}
n--;
return f(n/26) + string(1,'a'+n%26);
}
int main()
{
ll n;
cin>>n;
cout<<f(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 | n = int(input())
ans = ""
while n:
n -= 1
q, r = divmod(n, 26)
ans += chr(ord("a")+r)
n = q
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 sc = new Scanner(System.in);
System.out.println(alphabet(sc.nextLong()));
}
public static String alphabet(long num) {
int firstAlpha = (int)'a';
int sizeAlpha = 26;
if (num <= sizeAlpha) {
return String.v... | 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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
ArrayList<Character> list = new ArrayList<Character>();
while(n > 0) {
int amari = (int) (n % 26);
list.add(toS(amari));
if(n % 26 == 0) {
n -= 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.math.BigInteger;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
BigInteger n = sc.nextBigInteger()... | 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;
char a[105];
int main(){
long long n,cnt=0;
cin>>n;
while(n){
n--;
a[cnt++]=n%26+'a';
n/=26;
}
for(int i=cnt-1;i>=0;i--)
cout<<a[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 | import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] main) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
PrintWriter out = new PrintWriter(System.out);
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 | import java.util.*;
import java.io.PrintWriter;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
long ts=26;
int count=0;
while(n-ts>0){
count++;
n-=ts;
ts*=26;
}
StringBuilder ans=new StringBuilder();
ts/=26;
n--;
for(int... | 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:
ans += chr((n-1)%26 + ord("A"))
n = (n-1) // 26
print(ans.lower()[::-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 N; cin >> N;
long k=N-1; string ans="";
ans=(char)('a'+k%26); k/=26;
while(k){ k--; ans=(char)('a'+k%26)+ans; k/=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 | #include <iostream>
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.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong()-1;
long val = 26;
int cnt = 1;
while (N >= val) {
cnt++;
N -= val;
val *= 26;
}
StringBuilder sb = new StringBuilder();
long tmp = N;
for (int i=0;i<c... | 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='abcdefghijklmnopqrstuvwxyz'
N=int(input())
name=''
while N>0:
N-=1
name+=a[N%26]
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) throws Exception {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
String str = "";
System.out.println(new StringBuilder(detectChar(a, str)).reverse().toString());
}
public static String dete... | 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.Collections;
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 b = 0;
List<Character> list = new ArrayList<>();
... | 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.util.*;
public class Main{
public static void main(final String[] args){
final Scanner sc = new Scanner(System.in);
String abc = "abcdefghijklmnopqrstuvwxyz";
Long alf = 26l;
Long N = sc.nextLong();
String ans = "";
for(;N>0;){
Lon... | 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 | #!/usr/bin/env python
from __future__ import division, print_function
import os
import sys
import string
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def main():
n = int(input())
n -= ... | 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 os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')
n = int(in... | 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())
ans = ''
cnt = 0
while(n>0):
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 | n = int(input())
s = ""
while n:
n -= 1
s = "".join([chr(n % 26 + ord("a")), 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;
int main(void) {
long long N;
cin >> N;
N--;
string ans = "";
while (N >= 0) {
char c = 'a' + (N % 26);
ans = c + ans;
N /= 26;
N--;
}
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.*;
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)
{
if(n%26==0)
{
sb.append('z');
n=n/26-1;
}
else
{
sb.append(... | 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();
System.out.println(calc(N));
sc.close();
return;
}
static String calc(long N) {
if (N == 0) {
ret... | 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 = int(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 n;
cin >> n;
string s;
while(n)
n--, s += char('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 | N = int(input()) - 1
ans = ''
while N >= 0:
ans = chr(N % 26 + 97) + ans
N = N // 26 - 1
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 sc = new Scanner(System.in);
long n = sc.nextLong();
n -= 1;
String ans = "";
while (n >= 0) {
ans = (char) ('a' + n % 26) + ans;
if (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.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long num = sc.nextLong();
ArrayList<Integer> numList = new ArrayList<Integer>();
while (true) {
int digit = (int)(num % 26L);
if (digit == 0) {
d... | 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(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 | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
void f(ll n)
{
if(n==0)return;
n--;
f(n/26);
putchar('a'+(n%26));
}
int main()
{
ll n;
cin>>n;
f(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.Scanner;
public 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--;
sb.append((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 | N = int(input())
ans = ''
while N:
N -= 1
N, mod = divmod(N, 26)
ans += chr(ord('a') + mod)
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 t = "";
while(N != 0){
t = (char)((N - 1) % 26 + 'a') + t;
N--;
N /= 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(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;
#define ll long long
int main()
{
ll N;
cin >> N;
string ans = "";
while (N > 0) {
N--;
ans.insert(ans.begin(), 'a' + N % 26);
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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while (n > 0) {
n--;
sb.insert(0, (char) ('a' + n % 26));
n = n / 26;
}
System.out.println(sb.toString());
}
}
... | 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;
N--;
string s;
while (N >= 0) {
s.insert(s.begin(), 'a' + (N % 26));
N = N / 26 - 1;
}
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 <iostream>
#define ll long long
using namespace std;
int main() {
ll n;
cin >> n;
string s = "";
while (n > 0) {
s = (char)((n - 1) % 26LL + 'a') + s;
n -= 1;
n /= 26;
}
cout << s;
} | 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(N%26+97)
N //= 26
print(ans[-1::-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;
long long n;
int main(){
scanf("%lld", &n);
string ans = "";
while (n > 0){
ans = (char) ((n-1)%26 + 'a') + ans;
n = (n-1) / 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 | #include <bits/stdc++.h>
using namespace std;
string f(int64_t n, string s)
{--n;
if (n < 26) {return char(n + 'a') + s;}
return f(n / 26, char(n % 26 + 'a') + s);}
int main()
{int64_t N; cin >> N;
cout << f(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 | n=int(input())
ans=""
while 0 < n:
d=n%26
if d==0:
d=26
ans=chr(int(d)+96) + ans
n=(n-d)/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 scanner = new Scanner(System.in);
long N = scanner.nextLong();
long[] num = new long[50];
int k = 0;
while(N > 0) {
num[++k] = (N - 1) % 26;
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:
tmp = (n-1)%26
ans += chr(ord('a')+tmp)
n-=1
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 sc = new Scanner(System.in);
long n = sc.nextLong(); String s = "";
while (n > 0) {
int mod = (int) (n % 26 + 96);
n -= (n % 26 == 0 ? 26 : n % 26);
if (mod == 96... | 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
void f(ll n)
{
if (n == 0)
return;
n--;
f(n / 26);
putchar('a' + (n % 26));
}
int main()
{
ll n;
scanf("%lld", &n);
f(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.*;
class Main {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
long N = scan.nextLong();
System.out.println(dogName(N));
}
private static String dogName(long N) {
String ans = "";
long temp = N;
while(temp > 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 | #include <stdio.h>
#define LL long long
int st[20],top;
int main(){
LL n;
int i;
scanf("%lld",&n);
while(n){
st[++top]=(n-1)%26;
n--;
n/=26;
}
for(i=top;i>=1;i--)printf("%c",'a'+st[i]);
printf("\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 | N = int(input())
ans = ""
while N > 0:
x = (N-1) % 26
ans = chr(ord('a') + x) + 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 | 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:
name = chr(ord('a') + (N-1) % 26)+name
N = (N-1) // 26
print(name)
| 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
n = N % 26
ans = chr(ord("a") + n) + 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 | N = int(input())
t = ''
while N > 0:
N -= 1
t += chr(N % 26 + ord('a'))
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 | n = int(raw_input())
def f(n):
r = []
while(n):
r.append(chr(ord('a') + (n-1)%26))
n -=1
n /= 26
return ''.join(r[::-1])
print f(n) | 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())
l = []
while N:
N -= 1
l.append(chr(97+(N % 26)))
N //= 26
print("".join(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())
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;
vector<char>v;
cin>>n;
while(1)
{
n--;
int i = n%26;
n/=26;
v.push_back('a'+i);
if(!n)break;
}
reverse(v.begin(),v.end());
for(char c:v)cout<<c;
} | 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>
using namespace std;
int main(){
long long s;
cin>>s;
string ans="";
while(s)
{
long long h=(--s)%26;
ans=char('a'+h)+ans;
s=s/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())
ans = ''
while n>0:
n-=1
r = n%26
ans += chr(97+r)
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;
using ll=long long;
int main(){
ll N;
cin>>N;
string ans="";
while(N){
N-=1;
ans.push_back('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):
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--) {
s += char(n % 26 + 'a');
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
long n;
cin >> n;
string ans;
while(n){
ans.push_back(--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 | import java.util.Scanner;
public class Main {
public static final int MOD = 1000000007;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = Long.parseLong(sc.next());
StringBuilder sb = new StringBuilder();
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, res = int(input()), ""
while N > 0:
N, R = divmod(N-1, 26)
res = chr( 65+ R) + res
print(res.lower())
| 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 sc = new Scanner(System.in);
long n = sc.nextLong();
String ans = "";
while (true) {
long c = n % 26;
if (c == 0) {
c = 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)
n = 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;
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 > 0L) {
--n;
sb.append((char) ('a' + n % 26L));
n /= 26L;
}
sb.reverse();
System.out.println(sb.t... | 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();
StringBuilder sb = new StringBuilder();
boolean flag = false;
if(n == 1)
flag = true;
while(--n >= 1) {
long res = 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 | 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 | n = int(input())
name = ''
while n>0:
n -= 1
name += chr( ord('a')+n%26 )
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 | N=int(input())
P=''
while True :
P=chr(ord('a')+(N-1)%26)+P
N=(N-1)//26
if N <= 0 :
break
print(P) | 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(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.io.*;
public class Main{
public static void main(String args[]) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
out.println(go(Long.parseLong(br.readLine().trim())))... | 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 scanner = new Scanner(System.in);
String s = "";
long n = scanner.nextLong();
while (n-- > 0){
s = (char)('a' + (n%26)) + s;
n /= 26;
}
System.out.println(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.*;
import java.util.Map.Entry;
class Main {
static int mod = (int) (Math.pow(10,9)+7);
// static int mod = (int) 998244353;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong()-1;
int[] m = new int[10... | 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 | mod = int(1e9+7)
def add(a, b):
c = a + b
if c >= mod:
c -= mod
return c
def main():
#A, B = [int(x) for x in raw_input().split()]
N = int(raw_input())
temp = []
while N > 0:
#print(N)
ch = ' '
if N % 26 == 0:
ch = 'z'
else:
... | 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())
c = ''
while n>0:
n-=1
c+=chr(ord('a')+n%26)
n//=26
print(c[::-1]) # reverse and print | 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 <bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
string s;
while(n>0){
n--;
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 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x;
cin>>x;
char u[20];
int i=0;
while(x!=0){
x--;
int j=x%26;
u[i]=char(j+'a');
x/=26;
i++;
}
while(i--){
cout<<u[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 | #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;
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 N;
cin >> N;
string s;
do {
N--;
s += 'a' + (N % 26);
N /= 26;
}while(N > 0);
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 long int n;
cin>>n;
n--;
string res;
while(n>=0)
{
long long int r=n%26;
res+='a'+r;
n/=26;
n--;
}
reverse(res.begin(),res.end());
cout<<res;
}
| 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//=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 | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
string s="";
cin>>n;
while(n!=0)
{
if(n%26)
{
s=(char)(96+n%26)+s;
}
else
{
s='z'+s;
n-=26;
}
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;
int main()
{
long long n;
cin>>n;
string ans;
while(n>0)
{
int m=(n-1)%26;
ans+=(m+'a');
n=(n-m)/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 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N; cin >> N;
string s;
do{--N; s.insert(s.begin(), (char)('a'+N%26));}
while(N/=26);
cout << s << endl;
return 0;
} | CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.