Search is not available for this dataset
name stringlengths 2 112 | description stringlengths 29 13k | source int64 1 7 | difficulty int64 0 25 | solution stringlengths 7 983k | language stringclasses 4
values |
|---|---|---|---|---|---|
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
String s="abcdefghijklmnopqrstuvwxyz";
char[] c=s.toCharArray();
StringBuilder s1=new StringBuilder();
while(n>0)
{
long x=Math.abs(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 long mod(long x, long y) {
return x%y<0?x%y+(y<0?-y:y):x%y;
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long a = sc.nextLong()-1;
StringBuilder sb = new StringBuilder();
String str[] = {"a","b","c","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 | import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;
public class Main {
public static final int MOD = 1000000007;
public static void main(String[] args) {
int i,j;
Scanner sc = new Sca... | 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())
n -= 1
ans = []
while n >= 0:
ans.append(chr(ord("a")+n%26))
n //= 26
n -= 1
print(*ans[::-1],sep="") | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <iostream>
#include <vector>
using namespace std;
int main(){
long long n;
cin >> n;
string ans = "";
while (n --) {
ans = (char)('a' + (int)(n % 26)) + ans;
n /= 26;
}
cout << ans << endl;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | 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) + ans
n //= 26
print(ans)
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
string res = "";
while (N) {
N--;
res += (char)('a' + (N % 26));
N /= 26;
}
reverse(res.begin(), res.end());
cout << res << endl;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while(n-->0){
sb.append((char)('a'+n%26));
n/=26;
}sb.reverse();
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;
string ans;
while(n){
n--;
ans+='a'+n%26;
n/=26;
}
reverse(ans.begin(),ans.end());
cout << ans << endl;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | N = int(input())
S = ""
while 0<N:
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 | n = int(input())
ans = ''
while n > 0:
n, r = divmod(n-1, 26)
ans = chr(r+ord('a')) + ans
print(ans)
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.solve();
}
public void solve() {
Scanner scan = new Scanner(new BufferedRead... | 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 Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
long n=scanner.nextLong();
String s="";
while (n>0)
{
long i = n%26;
if(i==0)
{
i=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.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
long n = s.nextLong();
String a = "";
long counter = 0;
while(n>0){
counter= (n-1)%26;
char a1 = (char)('a'+counter);
... | 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;
string f(int64_t n) {
if (n == 0) return "";
n--;
return f(n/26) + (char)('a' + n%26);
}
int main() {
int64_t 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 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n;
cin>>n;
int a=0;
string s;
while(n>0){
n=n-1;
s+=char('a'+n%26);
n=n/26;
}
int i=s.length()-1;
string s1="";
while(i>=0){
s1+=s[i];
i--;
}
cout<<s1<<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;
typedef long long ll;
void print(ll n)
{ if(n>0) {
n--;
print(n/26);
cout<<(char)(n%26+97);
} }
int main(){
ll x;
cin>>x;
print(x);
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n=int(input())
l=[]
while n>0:
l.append(chr(97+(n-1)%26))
n-=1
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 | #include <bits/stdc++.h>
using namespace std;
string f(long long n){
if(n == 0) return "";
n--;
return f(n/26) + string(1, 'a'+n%26);
}
int main(){
long long n;
cin >> n;
cout << f(n) << 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())
x = 26
ans = ""
while n:
n -= 1
ans += chr(ord("a") + (n % x))
n //= x
print(ans[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | N = int(input())
name = ''
while N!=0:
N -= 1
name = chr(ord('a')+N%26) + name
N = N//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 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
// your code goes here
ll n;
cin>>n;
string str="";
while(n>0){
n--;
char ch=((n%26)+'a');
str=ch+str;
n/=26;
}
cout<<str<<endl;
return 0;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
String ans = "";
while(n != 0) {
n--;
ans += (char)('a'+n%26);
n/=26;
}
for(int i = ans.length()-1; i >= 0; i--) {
System.out.print(ans.charAt(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 | # template by 3xC and starkizard.
# contributors:
#####################################################################################
from __future__ import division, print_function
import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io
"""Uncomment modul... | 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 int;
ll n;
string k;
void displ()
{
cin>>n;
while(n){
k = char(n%26?(n%26)+'a'-1:'z')+k,n--;
n/=26;
}
cout<<k<<"\n";
}
int main()
{
displ();
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n;
int main(){
cin >> n;
string ans = "";
while(n>0){
n--;
ans = char((n)%26+'a')+ans;
n/=26;
}
cout << ans << endl;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,tmp,minor;
int main(){
string s="";
cin>>n;
while(n>0){
tmp=n%26;
n/=26;
if(!tmp){
tmp=26;
n--;
}
s=char(tmp-1+'a')+s;
}
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 = int(input())
name = []
while n:
n-=1
name.append(chr(97 + (n%26)))
n//=26
name.reverse()
print(''.join(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())
s=""
while n: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 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N; cin >> N;
string ans = "";
while (N) {
N--;
ans += (char)('a' + (N % 26));
N /= 26;
}
reverse(ans.begin(), ans.end());
cout << ans << endl;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long n = scanner.nextLong();
int NUM = 26;
int BASE = 96;
StringBuilder builder = new StringBuilder();
while (n > NUM) {
int val ... | 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();
long n=N;
long max=(long)Math.pow(10, 15)+1;
String res="";
while(N>0){
N--;
res = ... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
res = ""
while n:
n -= 1
res += chr(ord('a')+n%26)
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 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n; cin>>n;
string s;
while(n>0){
n-=1;
s+=('a'+n%26);
n/=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;
typedef long long ll;
int main(){
ll n;
cin >> n;
string sol = "";
while(n){
n--;
char cur = (n % 26) + 'a';
sol = cur + sol;
n /= 26;
}
cout << sol << '\n';
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while (n>0) {
n -=1;
long amari = n % 26;
sb.append((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 | #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 | N = int(input())
ans = ''
while N:
N -= 1
ans += chr(ord('a') + N%26)
N //= 26
print(ans[::-1]) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
s = ""
while n > 0:
n -= 1
s += chr( n % 26 + ord('a') )
n //= 26
print(s[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
string ans;
while (N) {
--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.*;
import java.lang.*;
import java.io.*;
class Main {
private static BufferedReader br;
public static void main (String[] args) throws java.lang.Exception {
br= new BufferedReader(new InputStreamReader(System.in));
long num = Long.parseLong(br.readLine());
StringBuilder str = ... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n=int(input())-1
radix=26
ord_a=97
ans=""
while n>=0:
n,m=divmod(n,radix)
ans=chr(m+ord_a)+ans
n-=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.*;
import java.io.PrintWriter;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
long n=sc.nextLong()-1;
ArrayList<Character> list=new ArrayList<>();
while(n>=0){
list.add((char)('a'+n%26));
n/=26;
n--;
}
for(int i=list.size()-1; i>=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 n;
list <char> s;
cin>>n;
while(n){
n--;
s.push_front('a'+n%26);
n/=26;
}
string ss(s.begin(), s.end());
cout<<ss<<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 >= 1:
N -= 1
ans.append(chr(97 + N % 26))
N //= 26
print(''.join(ans[::-1]))
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <iostream>
#include <string>
using namespace std;
string s="";
int main(){
unsigned long long int N;
cin>>N;
while(N){
s=(char)('a'+(N-1)%26)+s;
N--;
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 = 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;
cin>>n;
string ans = "";
while(n>=1){
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 | 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 | import java.util.*;
import java.util.stream.Collectors;
public class Main {
public static void main(String[] args) {
final Scanner sc = new Scanner(System.in);
long N = sc.nextLong()-1;
List<Integer> list = new ArrayList<>();
list.add(Long.valueOf(N%26).intValue());
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:
N -= 1
ans = chr(ord('a') + N % 26) + ans
N //= 26
print(ans)
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
string ans;
cin >> n;
while(n>=1){
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 | q = int(input())
s = ""
while q != 0:
q -= 1
s += chr(q % 26 + 97)
q = q // 26
print(s[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n=int(input())
s=''
while n!=0:
n,v=divmod(n,26) if n%26 else (n//26-1,26)
s+=chr(96+v)
#print(v)
print(s[::-1]) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main( )
{
ll n;
cin>>n;
string a="";
while(n){
n--;
a+=char('a'+n%26);
n=n/26;
}
reverse(a.begin( ),a.end( ));
cout<<a<<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 n = sc.nextLong();
StringBuilder sb = new StringBuilder();
while (true) {
n--;
sb.insert(0, (char) ('a' + n % 26));
n /= 26;
if (n == 0) {
break;
... | 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.Collections;
public class Main {
public static void main(String[] args){
Scanner sc = null;
sc = new Scanner(System.in);
long N = sc.nextLong();
String ans = "";
while(N-- > 0){
ans = (char)('a' + (N%26)) + ans;
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 | //package ABC171;
import java.util.*;
import java.io.*;
class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
char ch[]=new char[27];
for(int i=1;i<=26;i++)
{
ch[i]=(char)('a'+i-1);
}
HashMap<Long,Char... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n;cin >> n;
string s = "";
while(n){
n--;
s += char('a'+n%26);
n /= 26;
}
reverse(s.begin(),s.end());
cout << s << "\n";
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
string res;
while (n > 0) {
res = char('a' + --n % 26) + res;
n /= 26;
}
cout << res << endl;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | 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())
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;
class Main {
static final char[] ALPHA = {'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 final long BASE = 26;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
long n = s.nextLong(... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
typedef long long l;
string s="";
int main()
{
l n;
cin>>n;
while(n>=1)
{
n--;
l p=n%26;
s+=(p+'a');
n=n/26;
}
reverse(s.begin(),s.end());
cout<<s<<endl;
return 0;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
s=""
while n>0:
n-=1
c = chr(ord('a')+n%26)
s = c+s
n//=26
print(s) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
ans = ''
while n > 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())
s = ""
while n > 0:
n -= 1
s = chr(ord("a") + n % 26) + s
n //= 26
print(s)
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long x;
long y;
char[] out = new char[11]; // 1000000000000001 <= 26^10とちょっとくらい?なので11桁
for (int 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;
int main()
{
long long int n;
cin>>n;
char a[100];
int k=0;
while(n>0)
{
n=n-1;
int b=n%26;
a[k]=b+'a';
k++;
n=n/26;
}
for(int i=k-1;i>=0;i--)
cout<<a[i];
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = Long.parseLong(sc.next());
int c = 'a';
StringBuilder sb = new StringBuilder();
while (true) {
long remainder = (n - 1) % 26;
sb.append((char) (c + remainder));
... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n=int(input())
name=""
for i in range(15):
n=n-1
name=name+chr(97+n%26)
n=n//26
if n==0:
break
print(name[::-1]) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
long N = keyboard.nextLong();
String S = "abcdefghijklmnopqrstuvwxyz";
String[] s = S.split("");
StringBuffer ans = new StringBuffer("");
while(N > 0) {
int j = (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 | n = int(input())
ans = ""
while n > 0:
n = 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 | // 提出時に消す
import java.util.Scanner;
// 提出時にMainに変更する
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
StringBuilder ans = 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 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long N = scan.nextLong();
StringBuilder sb = new StringBuilder();
while(true) {
N--;
sb.append((char)('a' + (N % 26)));
if(N < 26) {
break;
}
N /= 26;
}
Syste... | 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.function.*;
import java.math.*;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
long N = Long.valueOf(s.next());
char[] ret;
int keta = 0;
long now = 1;
while(true) {
now *= 26;
keta++;
if(N <= now) {
... | 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>
int main() {
int64_t N;
scanf("%lld", &N);
std::string ans;
while (N > 0) {
N--;
ans += 'a' + (N%26);
N /= 26;
}
std::reverse(ans.begin(), ans.end());
printf("%s\n", ans.c_str());
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int a[1010];string ans;
int main()
{
long long n;
cin>>n;
while(n)
{
ans=(char)(97+(n-1)%26)+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 | n = int(input())
c = ''
while n > 0:
n -= 1
c += chr(ord('a') + n % 26)
n = n//26
print(c[::-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 = java.lang.Long.parseLong(sc.next());
sc.close();
String ans = "";
while( n > 0) {
n -= 1;
ans += (char)('a' + n % 26);
n /= 26;
}
for(int i = 0; i < ans.le... | 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;
void f(long long n)
{
if(n<=0) return;
f((n-1)/26);
cout << char((n-1)%26+'a');
}
int main() {
long long n;
cin >> n;
f(n);
return 0;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.Scanner;
public class Main {
public Main() {
Scanner scanner = new Scanner(System.in);
long N = scanner.nextLong();
String R = "";
while(N > 0){
char C = (char)(N%26L);
if(C == 0) C = 26;
N = (N - C) / 26L;
C = (char... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <iostream>
using namespace std;
int main(){
string s;
long l;
cin>>l;
while(l--){
s=char('a'+int(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 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
StringBuilder sb = new StringBuilder();
while(0 < N) {
N--;
sb.append((char)('a' + N%26));
N /= 26;
... | 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 ans;
do {
ans.push_back(97 + (--n % 26));
n /= 26;
} while (n > 0);
reverse(ans.begin(), ans.end());
cout << ans << endl;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
long long n;
int main(){
cin>>n;
string ans="";
while(n){
int r=(n-1)%26+1;
n=(n-r)/26;
char c=('a'+r-1);
ans=c+ans;
}
cout<<ans<<'\n';
return 0;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
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 | N,a=int(input()),''
while 0<N:N-=1;a+=chr(97+N%26);N//=26
print(a[::-1]) | PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll n;
cin>>n;
string s;
while(n){
n--;
s+=(n%26+'a');
n/=26;
}
reverse(s.begin(),s.end());
cout<<s;
}
| CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | N = int(input())
name = ''
while N>0:
N, r = divmod(N-1, 26)
name = chr(65+r)+name
print(name.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 | nb=int(input())
s = []
while nb>0:
nb-=1
s.append(chr(ord("a")+nb%26))
nb//=26
roger = "".join(s)
print(roger[::-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<stdio.h>
int main(void)
{
long long N;int sz=0,str[12]={0};
if(!scanf("%lld",&N))return 0;
while(N){N--;str[sz++]='a'+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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong() - 1;
long base = 26;
int idx = 0;
long[] counts = new long[10];
for (int i = 0; i < 11; i++) {
if (n - base < 0) {... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long now = 0;
int keta = 1;
while(N > now) {
now = now + (long)Math.pow(26,keta);
keta++;
}
keta--;
now = now - (long)Math.pow(26,keta);
long shou = N-now-... | JAVA |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | n = int(input())
s = ""
while n:
n -= 1
s = chr(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 | n=int(input()) #96
a=""
while n>0:
n-=1
rem=n%26
a+=chr(97+rem)
n=(n-rem)//26
print(a[::-1])
| PYTHON3 |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 |
import java.util.Map.Entry;
import java.util.*;
import java.math.*;
import org.w3c.dom.css.Counter;
public class Main{
public static void main(final String[] args){
final Scanner sc = new Scanner(System.in);
ArrayList<String> allmen =new ArrayList <String>(){{}};
String abc = "... | 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>
int main() {
long long n; std::cin >> n;
std::string name = "";
while (n-- > 0) {
name += 'a' + n % 26;
n /= 26;
}
std::reverse(name.begin(), name.end());
std::cout << name << std::endl;
} | CPP |
p02629 AtCoder Beginner Contest 171 - One Quadrillion and One Dalmatians | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:
* the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`;
* the dogs numbered 27,28,29,\... | 6 | 0 | import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
String name = "";
String alphabet = "";
for(char c = 'a'; c <= 'z... | JAVA |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.