結果

問題 No.207 世界のなんとか
ユーザー youthfuldays072youthfuldays072
提出日時 2018-05-20 11:46:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 72,052 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2023-09-10 23:56:59
合計ジャッジ時間 5,476 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,692 KB
testcase_01 AC 120 ms
55,684 KB
testcase_02 AC 126 ms
56,108 KB
testcase_03 AC 123 ms
56,048 KB
testcase_04 AC 123 ms
56,116 KB
testcase_05 AC 127 ms
55,724 KB
testcase_06 AC 121 ms
55,916 KB
testcase_07 AC 120 ms
55,832 KB
testcase_08 AC 121 ms
56,288 KB
testcase_09 AC 125 ms
55,456 KB
testcase_10 AC 125 ms
56,204 KB
testcase_11 AC 125 ms
55,712 KB
testcase_12 AC 125 ms
55,536 KB
testcase_13 AC 126 ms
55,380 KB
testcase_14 AC 126 ms
55,648 KB
testcase_15 AC 124 ms
55,380 KB
testcase_16 AC 121 ms
55,520 KB
testcase_17 AC 121 ms
55,980 KB
testcase_18 AC 120 ms
56,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {


    public static void main(String[] args) {

    	Scanner sc=new Scanner(System.in);

    	int start=sc.nextInt();
    	int end=sc.nextInt();

    	for(int i=start;i<=end;i++) {

    		if(isAho(i)) {
    			System.out.println(i);
    		}

    	}

    	sc.close();


    }

    public static boolean isAho(int n) {


    	if(n%3==0) {
    		return true;
    	}

    	return containTree(n);

    }

    public static boolean containTree(int n) {

    	while(n>0) {

    		if(n%10==3) {
    			return true;
    		}

    		n/=10;

    	}

    	return false;

    }




}
0