結果

問題 No.207 世界のなんとか
ユーザー SuunnSuunn
提出日時 2018-11-22 09:26:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 70,916 KB
実行使用メモリ 57,656 KB
最終ジャッジ日時 2023-08-26 02:49:47
合計ジャッジ時間 5,592 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,680 KB
testcase_01 AC 125 ms
55,956 KB
testcase_02 AC 128 ms
55,808 KB
testcase_03 AC 126 ms
55,692 KB
testcase_04 AC 125 ms
55,984 KB
testcase_05 AC 126 ms
55,704 KB
testcase_06 AC 120 ms
57,656 KB
testcase_07 AC 123 ms
55,736 KB
testcase_08 AC 121 ms
55,760 KB
testcase_09 AC 124 ms
55,672 KB
testcase_10 AC 125 ms
55,420 KB
testcase_11 AC 126 ms
55,700 KB
testcase_12 AC 127 ms
55,748 KB
testcase_13 AC 128 ms
55,668 KB
testcase_14 AC 126 ms
55,808 KB
testcase_15 AC 125 ms
55,736 KB
testcase_16 AC 123 ms
55,544 KB
testcase_17 AC 121 ms
55,808 KB
testcase_18 AC 121 ms
55,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		for(int i=A;i<=B;i++){
			if(i%3==0||contain3(i)){
				System.out.println(i);
			}
		}
	}

	private static boolean contain3(int i) {
		while(i>1){
			if(i%10==3){
				return true;
			}
			i/=10;
		}
		return false;
	}
	

}
0