結果

問題 No.207 世界のなんとか
ユーザー YOSHIYOSHI
提出日時 2021-03-05 21:21:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 541 bytes
コンパイル時間 4,127 ms
コンパイル使用メモリ 78,888 KB
実行使用メモリ 41,708 KB
最終ジャッジ日時 2024-04-16 08:36:41
合計ジャッジ時間 6,948 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
41,332 KB
testcase_01 AC 137 ms
41,708 KB
testcase_02 AC 145 ms
41,516 KB
testcase_03 AC 142 ms
41,436 KB
testcase_04 AC 135 ms
41,484 KB
testcase_05 AC 141 ms
41,252 KB
testcase_06 AC 138 ms
41,180 KB
testcase_07 AC 132 ms
41,560 KB
testcase_08 AC 136 ms
41,356 KB
testcase_09 AC 143 ms
41,484 KB
testcase_10 AC 142 ms
41,184 KB
testcase_11 AC 141 ms
41,308 KB
testcase_12 AC 139 ms
41,572 KB
testcase_13 AC 140 ms
41,448 KB
testcase_14 AC 139 ms
41,432 KB
testcase_15 AC 139 ms
41,548 KB
testcase_16 AC 136 ms
41,324 KB
testcase_17 AC 137 ms
41,372 KB
testcase_18 AC 138 ms
41,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.util.Scanner;

public class No00000207_Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();

		for(int i = a; i <= b; i++) {
			if(i % 3 == 0 || with3(String.valueOf(i))) {
				System.out.println(i);
			}
		}
		scan.close();
	}

	private static boolean with3(String str) {
		for(int i = 0; i < str.length(); i++) {
			if(str.charAt(i) == '3') {
				return true;
			}
		}
		return false;
	}
}
0