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())
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 | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
long n = in.nextLong();
String s = "";
while(n > 0) {
long mod = n%26;
if(mod != 0) {
char c = (char) (96 + mod);
s = 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 | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
long long n;
cin>>n;
while(n--)
{
s=char(96+n%26+1)+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 | 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 |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong() -1;
List<Integer> list = new ArrayList<>();
while(N > 25) {
list.add((int)(N % 26));
N = N / 26 - 1;
}
list.add((int)N);
char[] alphabet = "abcdefghijklmnopq... | 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.PrintWriter;
import java.util.Scanner;
public class Main {
void solve(Scanner sc, PrintWriter pw) {
long N = sc.nextLong();
pw.println(func(N - 1));
}
private String func(long n) {
if (n < 26) {
return String.valueOf((char)('a' + n));
}
re... | 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())
l=[]
s=""
while n>0:
n=n-1
a=n%26
s=chr(a+97)+s
n=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;
long long n;
void print(long long x)
{
if(x==0){return;}
--x;
print(x/26);
char chr=x%26+'a';
cout<<chr;
}
int main(void)
{
cin>>n;
print(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();
String s = "";
while(n > 0) {
n--;
s = (char)('a' + n % 26) + s;
n /= 26;
... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while (n > 0) {
n--;
int t = (int) (n % 26);
sb.insert(0, (char) (97 + t));
n = n / 26;
}
System.out.println(sb.... | 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();
String tmp = "";
while(N>0) {
--N;
tmp += (char)('a' + (N%26));
N /= 26;
}
Strin... | 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 //= 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:
ans+=chr((n-1)%26+ord('a'))
n=(n-1)//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 scanner = new Scanner(System.in);
long n = scanner.nextLong();
List<Character> list = new ArrayList<Character>();
int i = 0;
while (n != 0) {
list.add((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())
a=[]
while n>0:
n-=1
a.append(chr(ord("a")+n%26))
n//=26
ans="".join(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 | FAST_IO = 1
if FAST_IO:
import io, sys, atexit
rr = iter(sys.stdin.read().splitlines()).next
sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
@atexit.register
def write():
sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().s... | 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 | #include<bits/stdc++.h>
using namespace std;
void Out(long long X)
{
if(X==0)
return ;
X--;
long long Rem=X%26ll;
Out(X/26ll);
cout<<(char)(Rem+'a');
}
int main()
{
long long X;
cin>>X;
Out(X);
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(97+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;
public class Main {
static long mod = 1000000007;
static long INF = Long.MAX_VALUE;
static long chmin(long a, long b) {
return Math.min(a, b);
}
static long chmax(long a, long b) {
return Math.max(a, b);
}
public static void main(String[] args) {
// AtCoder_C
Scanner sc = 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:
s.append(chr((n-1) % 26 + 97))
n = (n-1) // 26
print(''.join(list(reversed(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 {
// Driver program to test above function
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
long num = sc.nextLong();
StringBuilder columnName = new StringBuilder();
while (num > 0) {
long rem = num % 26;
if (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 | 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);
// 整数の入力
// final int a = sc.nextInt();
// 文字列の入力
// final String s1 = sc.next();
long resN = Long.parseLong(sc.next());
long mod... | 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,i,x,y;
string s;
s="";
cin>>n;
while(n>0)
{
x=(n-1)/26;
y=n-(26*x+1);
s+=('a'+y);
n=x;
}
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())
ans = ''
while n > 0:
n -= 1
a = n % 26
ans += chr(ord('a') + a)
n //= 26
print(ans[::-1]) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
r = ''
e = 26
while n > 0:
n -= 1
r = chr(97 + n % e) + r
n //= e
print(r) | 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:
c=chr((n-1)%26 + 97)
ans = c+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
ans = ans[::-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 | #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;
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 {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
long n = sc.nextLong();
String res = "";
while(n > 0){
char c = (char)((n % 26 == 0 ? 26 : n % 26) - 1 + 'a');
res = c + res;
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.util.Scanner;
class Main {
static int serialNum;
static String[] charList = {"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"};
static String output ="";
public static void main(String args[]){
Scanner sc = new Scanner(System.in... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x;
cin>>x;
vector<char>arr;
while(x>0){
x--;
arr.push_back((char)('a'+x%26));
x/=26;
}
for(int i=arr.size()-1; i>=0; i--) cout<<arr[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 | n = int(input())
res = ""
while n:
n -= 1
n, y = divmod(n, 26)
res = chr(y + 97) + 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 | n=int(input());ans="";i=0;
while(n>0):
n-=1;
a=n%26
ans+=chr(97+a);
n//=26;
print(ans[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
long n = scan.nextLong();
StringBuilder s = new StringBuilder();
while(n > 0)
{
char j = (char)(n % 26 + 96);
if(n%26 == 0) {
... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n;
cin>>n;
string s="";
while(n>0)
{
int j=(n-1)%26;
s.push_back((char)(j+'a'));
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.*;
import java.io.*;
public class Main{
public static void main(String[] $){
Scanner s = new Scanner(System.in);
long N = s.nextLong();
String Ans = "";
while(N != 0){
N = N-1;
long mod = N%26;
int mod2 = (int)mod;
char a = (char)('a'+mod2);
Ans = String.valueOf(a) + Ans;... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
#include<algorithm>
#include<string>
using namespace std;
int main(){
long long n;
cin>>n;
string s="";
while(n){
s=char('a'+(n-1)%26)+s;
n=(n-1)/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 s="";
while(n!=0){
int k=n%26;
if(k==0){
k=26;
n--;
}
s=(char)(k+'a'-1)+s;
n/=26;
}
cout<<s<<endl;
return 0;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n = sc.nextLong();
char[] s = new char[26];
for (int i = 0; i < 26; i++) {
s[i] = (char) ('a' + i);
// System.out.print(i+1+" ");
// System.out.println((char) ('a'+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<iostream>
using namespace std;
void func(long long int n){
if(n == 0) return;
n--;
func(n/26);
printf("%c", n%26 + 'a');
}
int main(){
long long int n;
cin >> n;
func(n);
cout << 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>
#define ll long long
using namespace std;
int main() {
ll n;
cin >> n;
string ans = "";
while (n) {
n--;
ans += ('a' + (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 string
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 | 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 | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,r,i;
string s="abcdefghijklmnopqrstuvwxyz";
string ans="";
cin>>n;
while(n!=0)
{
n--;
r=n%26;
ans=s[r]+ans;
n=n/26;
}
cout<<ans<<endl;
return 0;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | 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>
#include<cstdlib>
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<<'\n';
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | N=int(input())
ans=""
for _ in range(10**5):
N-=1
ans+=chr(ord("a")+(N%26))
N=N//26
if N<=0:
break
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 scan = new Scanner(System.in);
long n = scan.nextLong();
StringBuilder res = new StringBuilder();
String s = "";
for (int i = 0; i <= 25; i++) {
s += (char)('a' + 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 | FAST_IO = 0
if FAST_IO:
import io, sys, atexit
rr = iter(sys.stdin.read().splitlines()).next
sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
@atexit.register
def write():
sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().s... | 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 | #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;
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() - 1;
long b = 26;
int d = 1;
String res = "";
while(true) {
if(n < b) {
char[] c = new char[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 = ""
flag=False
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() {
// your code goes here
long long int n;
cin>>n;
string s;
while(n>0)
{
n--;
s+=char('a'+n%26);
n=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 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
int i = 0;
String ans = "";
while (true) {
if (n <= 26){
ans = (char) (96 + n) + ans;
break;
}
long mod = n % 26;
n = n / 26;
if (... | 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 l=sc.nextLong();
String ans="";
while(l-->0) {
ans=(char)('a'+(l%26))+ans;
l/=26;
}
System.out.println(ans);
}
}
| JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
String ret = "";
while(n>0) {
int c = (int)(n%26L);
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t n;
string alf,ans;
alf = "abcdefghijklmnopqrstuvwxyz";
cin >> n;
while(n>0){
ans = alf.at((n-1)%26) + ans;
n = (n-1)/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 | def f(n):
if n == 0:
return ''
n -= 1
return f(n//26) + chr(ord('a')+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 | #abc171c
n=int(input())
s=''
while n:
n-=1
s+=chr(n%26+97)
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 <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
int BASE = 26;
string ans = "";
while (0 < n) {
n--;
char c = 'a' + n % BASE;
n /= BASE;
ans.insert(ans.begin(), c);
}
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;
import java.util.Arrays;
public class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
long N = scan.nextLong();
String res = "";
//Nが0ではない間
while(N != 0){
N--;
res += (char)('a' + (N % 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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while (n > 0) {
n--;
int t = (int) (n % 26);
sb.insert(0, (char) ('a' + t));
n = n / 26;
}
System.out.println(sb... | 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.*;
class Main{
public static void main(String args[]){
Scanner obj=new Scanner(System.in);
long n=obj.nextLong();
StringBuilder result = new StringBuilder();
while(n>0){
n--;
result.insert(0, (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;
cin >> n;
string s;
while(n){
--n;
s.push_back(n%26 + 'a');
n /= 26;
}
reverse(s.begin(),s.end());
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 | n=int(input())
c=""
while n:
n-=1
c=chr(n%26+97)+c
n//=26
print(c) | 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<stdio.h>
#define ll long long
int main()
{
ll n, j = 0;
char str[255];
scanf("%lld", &n);
while(n != 0){
--n;
str[j++] = n % 26 + 'a';
n /= 26;
}
for(int i = j - 1; i >= 0; i--){
printf("%c", str[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 | N = int(input())
n = N
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 | 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)('a'+N%26));
N /= 26;
... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong()-1;
long gSize=26;
int length=1;
while(true) {
if(N<gSize) {
String ans = "";
for(int i=0; i<length; i++) {
ans = String.valueOf((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 | #include<bits/stdc++.h>
using namespace std;
int main(){
string ans="";
long long int n;
cin>>n;
n=n-1;
while(n>-1){
ans=ans+char('a'+(n%26));
n=n/26-1;
}
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.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
long n = sc.nextLong();
ArrayList<Character> name = new ArrayList<>();
for(;n>0;){
n -= 1;
name.add((char)(n%26+97));
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 | n=int(input())
z=""
while n>0:
n -= 1
z += chr(n%26 +ord('a'))
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 | 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 sb = new StringBuilder();
while (n > 26) {
long amari = (n % 26) ;
if(amari == 0) amari = 26;
sb.insert(0, (char)(amari... | 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 = input() - 1
l = 1
while n >= 26 ** l:
n -= 26 ** l
l += 1
s = ''
for _ in xrange(l):
s += chr(ord('a') + n % 26)
n /= 26
print s[::-1]
| 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 | #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;
}
| 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 name = new StringBuilder();
while (n > 0) {
long lowchar = n % 26;
if (lowchar == 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>
#include <stack>
typedef long long ll;
int main(void) {
ll n;
std::stack<char> s;
scanf("%lld", &n);
while(n) s.push(--n % 26 + 'a'), n /= 26;
while(s.size()) printf("%c", s.top()), s.pop();
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 | s = int(input())
ans = ""
while (s > 0):
s -= 1
ans += chr((s % 26) + ord("a"))
s //= 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.*;
import java.util.*;
public class Main
{
public static void main(String args[])throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
long n = Long.parseLong(br.readLine());
//StringTokenizer st = new StringTokenizer(br.readLine());
// for(int k=1;k<=n;k... | 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 = 26
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(){
int64_t n;
cin >> n;
string ans = "";
while (n > 0){
ans += 'a' + ((n - 1) % 26) ;
n = (n - 1) / 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<stdio.h>
int main(void)
{
long long N;int sz=0;char str[12];
if(!scanf("%lld",&N))return 0;
while(N){N--;str[sz++]=97+N%26;N/=26;}
for(int i=0;i<sz;i++)printf("%c",str[sz-i-1]);
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n;
vector<ll>a;
int main(){
cin>>n;
string s="";
while(n>0){
n--;
char c='a'+n%26;
s=c+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 | N, ans = int(input()), ''
while N > 0:
N -= 1
ans += chr(N % 26 + ord('a'))
N //= 26
print(ans[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n=int(input())
ans=""
while n>0:
n-=1
ans+=chr(97+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 | N = int(input())
ans = ""
while(N > 0):
N -= 1
ch = N % 26
ans = chr(97 + ch) + 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.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
long N = sc.nextLong() - 0;
int k = 1;
long n = 26;
long sum = 26;
long prev = 0;
for (; N > sum;) {
... | 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 | x = int(input())
ans = ""
while x > 0:
x -= 1
ans += chr(ord("a") + x % 26)
x //= 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(97 + 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;
vector<int> v;
string s="";
while(n)
{
n--;
s+=(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 <iostream>
using namespace std;
int main(){
string s;
long l;
cin>>l;
while(l--){
s=char('a'+l%26)+s;
l/=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 {
Scanner sc = new Scanner(System.in);
final int MOD = 998244353;
final int MAX = Integer.MAX_VALUE;
final long LMAX = Long.MAX_VALUE;
long inf = LMAX / 2 - MAX;
void doIt() {
long N = sc.nextLong() - 1;
LinkedList<Integer> stack = new LinkedList<>();
while(N >= 0) {
... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.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();
N = N-1;
long div = N;
int mod = 0;
List<Integer> list = new Ar... | 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=N-1
res +=chr(ord('a') + N%26)
N=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.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long N = scanner.nextLong();
StringBuilder builder = new StringBuilder();
while (N > 0) {
N--;
builder.append((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.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long n = Long.parseLong(sc.next());
int k = 26;
StringBuilder ans = new StringBuilder();
while(n != 0) {
char a = (char)(n % k +... | 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, ans = int(input()), ''
while N > 0:
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 | n=int(input())
s=''
while n>0:
s=chr((n-1)%26+97)+s
n=(n-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 | import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
BigInteger inu = new BigInteger(sc.next());
BigInteger t = new BigInteger("26");
StringBuilder sb = new Strin... | JAVA |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.