結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-02-19 21:01:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 83,696 KB
実行使用メモリ 54,356 KB
最終ジャッジ日時 2024-04-20 21:31:14
合計ジャッジ時間 5,382 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
54,112 KB
testcase_01 AC 119 ms
53,944 KB
testcase_02 AC 107 ms
52,832 KB
testcase_03 AC 116 ms
53,948 KB
testcase_04 AC 119 ms
53,856 KB
testcase_05 AC 120 ms
53,832 KB
testcase_06 AC 117 ms
53,908 KB
testcase_07 AC 105 ms
52,692 KB
testcase_08 AC 107 ms
52,580 KB
testcase_09 AC 115 ms
53,784 KB
testcase_10 AC 117 ms
54,268 KB
testcase_11 AC 104 ms
52,928 KB
testcase_12 AC 113 ms
54,356 KB
testcase_13 AC 117 ms
53,944 KB
testcase_14 AC 122 ms
53,940 KB
testcase_15 AC 117 ms
53,924 KB
testcase_16 AC 120 ms
53,896 KB
testcase_17 AC 128 ms
53,964 KB
testcase_18 AC 130 ms
53,904 KB
testcase_19 AC 123 ms
53,980 KB
testcase_20 AC 122 ms
54,124 KB
testcase_21 AC 109 ms
53,492 KB
testcase_22 AC 116 ms
53,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        final int MAX = 100;
        StringBuilder sb = new StringBuilder();
        int num = 1;
        while(true) {
            sb.append(num);
            if(sb.length() > MAX) break; 
            num++;
        }
        String s = sb.toString();
        System.out.println(s.charAt(d-1));
    }
}
0