Submission #26800415
Source Code Expand
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int n;
Scanner scan = new Scanner(System.in);
n = scan.nextInt();
int div = 0;
// nを超えない36のx乗を求める
int x = 0;
while (n >= Math.pow(36, ++x))
;
x--;
while (x > 0) {
int tmp = (int) Math.pow(36, x);
div = n / tmp;
n = n % tmp;
System.out.print(converter(div)); // 上位一桁出力
x--;
}
System.out.println(converter(n)); // 最後一桁出力
// System.out.println((int) '0');
// System.out.println((int) '9');
// System.out.println((int) 'a');
// System.out.println((int) 'A');
}
private static char converter(int decimal) {
if (decimal < 10) {
return (char) (decimal + 48);
} else {
return (char) (decimal + 55);
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Hexatridecimal |
| User | roider |
| Language | Java (OpenJDK 11.0.6) |
| Score | 8 |
| Code Size | 1023 Byte |
| Status | AC |
| Exec Time | 114 ms |
| Memory | 35608 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 8 / 8 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 114 ms | 35444 KiB |
| hand_02.txt | AC | 96 ms | 35432 KiB |
| hand_03.txt | AC | 101 ms | 35360 KiB |
| random_01.txt | AC | 104 ms | 35300 KiB |
| random_02.txt | AC | 98 ms | 35428 KiB |
| random_03.txt | AC | 103 ms | 35300 KiB |
| random_04.txt | AC | 104 ms | 35368 KiB |
| random_05.txt | AC | 109 ms | 35464 KiB |
| random_06.txt | AC | 97 ms | 35516 KiB |
| random_07.txt | AC | 103 ms | 35576 KiB |
| random_08.txt | AC | 101 ms | 35596 KiB |
| random_09.txt | AC | 104 ms | 35456 KiB |
| random_10.txt | AC | 96 ms | 35448 KiB |
| random_11.txt | AC | 104 ms | 35392 KiB |
| random_12.txt | AC | 100 ms | 35484 KiB |
| random_13.txt | AC | 100 ms | 35384 KiB |
| random_14.txt | AC | 101 ms | 35608 KiB |
| random_15.txt | AC | 103 ms | 35456 KiB |
| random_16.txt | AC | 98 ms | 35288 KiB |
| random_17.txt | AC | 102 ms | 35444 KiB |
| random_18.txt | AC | 96 ms | 35608 KiB |
| sample_01.txt | AC | 103 ms | 35360 KiB |
| sample_02.txt | AC | 104 ms | 35428 KiB |
| sample_03.txt | AC | 102 ms | 35424 KiB |