結果

問題 No.207 世界のなんとか
ユーザー kashiwagi513kashiwagi513
提出日時 2019-02-19 20:59:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 110 ms / 5,000 ms
コード長 535 bytes
コンパイル時間 1,763 ms
コンパイル使用メモリ 74,432 KB
実行使用メモリ 41,392 KB
最終ジャッジ日時 2024-04-20 21:23:39
合計ジャッジ時間 4,496 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
39,476 KB
testcase_01 AC 91 ms
39,528 KB
testcase_02 AC 102 ms
40,028 KB
testcase_03 AC 110 ms
40,860 KB
testcase_04 AC 107 ms
41,160 KB
testcase_05 AC 100 ms
40,072 KB
testcase_06 AC 109 ms
40,944 KB
testcase_07 AC 104 ms
41,076 KB
testcase_08 AC 101 ms
40,076 KB
testcase_09 AC 107 ms
40,960 KB
testcase_10 AC 94 ms
39,632 KB
testcase_11 AC 102 ms
40,248 KB
testcase_12 AC 101 ms
40,288 KB
testcase_13 AC 108 ms
40,480 KB
testcase_14 AC 109 ms
40,820 KB
testcase_15 AC 101 ms
40,092 KB
testcase_16 AC 93 ms
40,228 KB
testcase_17 AC 110 ms
41,272 KB
testcase_18 AC 105 ms
41,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static boolean hasThree(int n){
    	if(n==0){ return false; }
    	else if((n-3)%10 == 0){ return true; }
    	else { return hasThree(n/10); }
    }
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        for(int i = a; i <= b; i++){
            if (i%3 == 0 || hasThree(i)) { System.out.println(i);}
        }
    }
}
0