結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 130 ms
41,208 KB
testcase_04 AC 116 ms
40,020 KB
testcase_05 WA -
testcase_06 AC 114 ms
39,784 KB
testcase_07 AC 115 ms
40,032 KB
testcase_08 AC 128 ms
41,172 KB
testcase_09 AC 120 ms
40,276 KB
testcase_10 WA -
testcase_11 AC 124 ms
40,292 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 134 ms
41,200 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 115 ms
39,948 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 > 99 || 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