結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー daijidalidaijidali
提出日時 2018-12-05 20:23:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 3,205 ms
コンパイル使用メモリ 72,356 KB
実行使用メモリ 59,976 KB
最終ジャッジ日時 2023-09-27 11:00:06
合計ジャッジ時間 7,392 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,612 KB
testcase_01 AC 127 ms
55,576 KB
testcase_02 WA -
testcase_03 AC 121 ms
55,716 KB
testcase_04 WA -
testcase_05 AC 125 ms
55,888 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 126 ms
56,012 KB
testcase_09 AC 126 ms
55,728 KB
testcase_10 WA -
testcase_11 AC 125 ms
55,860 KB
testcase_12 WA -
testcase_13 AC 122 ms
55,528 KB
testcase_14 AC 123 ms
56,060 KB
testcase_15 AC 127 ms
55,800 KB
testcase_16 AC 121 ms
55,996 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 121 ms
55,636 KB
testcase_20 AC 124 ms
56,032 KB
testcase_21 AC 123 ms
56,000 KB
testcase_22 AC 127 ms
57,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package _test;

import java.util.Scanner;

public class No756 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		int length = 0;
		int ans = 0;
		for (int i = 1; i <= 100; i++) {
			if (i < 10)
				length += 1;
			else if (i < 100)
				length += 2;
			else
				length += 3;

			if (length >= D) {
				if (length == D) {
					ans = i % 10;
				} else {
					if (i < 100) {
						ans = i % 10;
					} else {
						ans = i % 100;
					}
				}
				break;
			}
		}
		System.out.println(ans);
	}
}
0