結果

問題 No.207 世界のなんとか
ユーザー CecilCecil
提出日時 2022-12-20 11:23:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 75,556 KB
実行使用メモリ 56,140 KB
最終ジャッジ日時 2024-04-29 02:43:45
合計ジャッジ時間 5,352 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 131 ms
41,116 KB
testcase_04 AC 131 ms
41,696 KB
testcase_05 WA -
testcase_06 AC 130 ms
41,140 KB
testcase_07 AC 130 ms
41,184 KB
testcase_08 AC 131 ms
41,400 KB
testcase_09 AC 129 ms
41,040 KB
testcase_10 WA -
testcase_11 AC 119 ms
40,032 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 132 ms
41,420 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 115 ms
39,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		int a = scan.hasNextInt() ? scan.nextInt() : -1;
		int b = scan.hasNextInt() ? scan.nextInt() : -1;
		if (a > 2000000000 || a < 1 || b > 2000000000 || b < 1) {
			System.out.println("入力エラー1");
			return;
		}
		int count = b - a;
		if (count > 100 || count < 0 ) {
			System.out.println("入力エラー2");
			return;
		}
		
		for(int i = a; i < b; i++){
		    if(i >= 3){
    		    if(Integer.toString(i).contains("3")){
    		         System.out.println(i);
	    	    }
		        else if(i % 3 == 0){
		            System.out.println(i);
		        }
		    }
		}

	}
}
0