結果

問題 No.207 世界のなんとか
ユーザー k__umek__ume
提出日時 2019-04-28 19:20:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 786 bytes
コンパイル時間 2,359 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 50,912 KB
最終ジャッジ日時 2023-08-22 18:19:38
合計ジャッジ時間 4,662 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
50,476 KB
testcase_01 AC 54 ms
50,860 KB
testcase_02 AC 59 ms
50,772 KB
testcase_03 AC 57 ms
50,396 KB
testcase_04 AC 56 ms
50,464 KB
testcase_05 AC 56 ms
50,616 KB
testcase_06 AC 59 ms
50,464 KB
testcase_07 AC 54 ms
50,568 KB
testcase_08 AC 55 ms
50,444 KB
testcase_09 AC 57 ms
50,632 KB
testcase_10 AC 58 ms
50,564 KB
testcase_11 AC 57 ms
50,700 KB
testcase_12 AC 57 ms
50,408 KB
testcase_13 AC 58 ms
50,524 KB
testcase_14 AC 59 ms
50,448 KB
testcase_15 AC 57 ms
50,476 KB
testcase_16 AC 54 ms
50,284 KB
testcase_17 AC 53 ms
50,912 KB
testcase_18 AC 52 ms
50,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String... args) throws IOException {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] arr = Arrays.stream(reader.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            for (int i = arr[0]; i <= arr[1]; i++) {
                if (i % 3 == 0 || has3(i)) {
                    System.out.println(i);
                }
            }
        }
    }
    static boolean has3(int num) {
        for (int i = num; 0 < i; i /= 10) {
            if (i % 10 == 3) {
                return true;
            }
        }
        return false;
    }
}
0