結果

問題 No.207 世界のなんとか
ユーザー omc-testomc-test
提出日時 2016-08-04 08:48:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 393 bytes
コンパイル時間 2,499 ms
コンパイル使用メモリ 74,416 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-04-24 15:17:11
合計ジャッジ時間 5,539 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,312 KB
testcase_01 AC 132 ms
41,304 KB
testcase_02 AC 140 ms
41,424 KB
testcase_03 AC 136 ms
41,452 KB
testcase_04 AC 134 ms
41,032 KB
testcase_05 AC 135 ms
41,380 KB
testcase_06 AC 134 ms
41,280 KB
testcase_07 AC 130 ms
41,228 KB
testcase_08 AC 116 ms
40,236 KB
testcase_09 AC 136 ms
41,032 KB
testcase_10 AC 135 ms
41,368 KB
testcase_11 AC 128 ms
40,236 KB
testcase_12 AC 126 ms
40,248 KB
testcase_13 AC 133 ms
41,336 KB
testcase_14 AC 132 ms
41,380 KB
testcase_15 AC 131 ms
41,352 KB
testcase_16 AC 132 ms
41,464 KB
testcase_17 AC 132 ms
40,996 KB
testcase_18 AC 130 ms
41,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		sc.close();

		for(int i=0; i<=b-a; i++){
			String str = String.valueOf(a + i);
			if((a+i) % 3 == 0){
				System.out.println(a + i);
			}else if(str.indexOf("3") != -1){
				System.out.println(a + i);
			}
		}
	}
}
0