結果
| 問題 | No.327 アルファベット列 |
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2015-12-20 00:22:45 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 657 bytes |
| コンパイル時間 | 2,591 ms |
| コンパイル使用メモリ | 79,204 KB |
| 実行使用メモリ | 56,952 KB |
| 最終ジャッジ日時 | 2024-09-17 11:07:12 |
| 合計ジャッジ時間 | 13,038 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 21 |
ソースコード
import java.net.NetworkInterface;
import java.util.*;
public class Main {
static long gcd(long a,long b){
return b == 0 ? a : gcd(b, a%b);
}
static long lcm(long a, long b){
return a*b/gcd(a, b);
}
static int[] dx = {1,0,-1,0};
static int[] dy = {0,1,0,-1};
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
String ans = "";
ans+=(char)((int)'A'+n%26);
int ind = 1;
while(n>=Math.pow(26, ind)) ind++;
ind--;
String unko="";
for(int i=ind;i>=1;i--){
unko+=(char)((int)'A'+(int)(n/Math.pow(26, i))-1);
n%=Math.pow(26, i);
}
System.out.println(unko+ans);
}
}
kou6839