結果
問題 | No.2246 1333-like Number |
ユーザー | tenten |
提出日時 | 2023-03-20 16:29:49 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 57 ms / 2,000 ms |
コード長 | 1,924 bytes |
コンパイル時間 | 2,760 ms |
コンパイル使用メモリ | 91,112 KB |
実行使用メモリ | 53,588 KB |
最終ジャッジ日時 | 2023-10-18 18:08:07 |
合計ジャッジ時間 | 5,344 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 54 ms
53,548 KB |
testcase_01 | AC | 54 ms
53,580 KB |
testcase_02 | AC | 54 ms
52,484 KB |
testcase_03 | AC | 54 ms
53,588 KB |
testcase_04 | AC | 55 ms
53,576 KB |
testcase_05 | AC | 55 ms
53,584 KB |
testcase_06 | AC | 54 ms
53,580 KB |
testcase_07 | AC | 55 ms
52,540 KB |
testcase_08 | AC | 55 ms
53,580 KB |
testcase_09 | AC | 55 ms
53,580 KB |
testcase_10 | AC | 54 ms
53,528 KB |
testcase_11 | AC | 56 ms
53,588 KB |
testcase_12 | AC | 55 ms
53,580 KB |
testcase_13 | AC | 54 ms
53,588 KB |
testcase_14 | AC | 55 ms
53,588 KB |
testcase_15 | AC | 54 ms
53,584 KB |
testcase_16 | AC | 55 ms
53,580 KB |
testcase_17 | AC | 56 ms
53,572 KB |
testcase_18 | AC | 56 ms
53,588 KB |
testcase_19 | AC | 55 ms
53,580 KB |
testcase_20 | AC | 57 ms
53,584 KB |
testcase_21 | AC | 55 ms
53,580 KB |
testcase_22 | AC | 56 ms
53,576 KB |
testcase_23 | AC | 57 ms
53,548 KB |
testcase_24 | AC | 56 ms
53,576 KB |
testcase_25 | AC | 54 ms
53,580 KB |
testcase_26 | AC | 55 ms
53,580 KB |
ソースコード
import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt() - 1; ArrayList<Integer> list = new ArrayList<>(); for (int i = 1; i <= 9; i++) { for (int j = i + 1; j <= 9; j++) { list.add(i * 10 + j); } } int length = n / list.size(); int idx = n % list.size(); char c = (char)(list.get(idx) % 10 + '0'); char[] output = new char[length]; Arrays.fill(output, c); System.out.print(list.get(idx)); System.out.println(output); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }