結果

問題 No.207 世界のなんとか
ユーザー ぴろずぴろず
提出日時 2015-05-15 22:22:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 2,419 ms
コンパイル使用メモリ 73,752 KB
実行使用メモリ 41,592 KB
最終ジャッジ日時 2024-04-17 15:18:49
合計ジャッジ時間 4,403 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
41,184 KB
testcase_01 AC 107 ms
41,136 KB
testcase_02 AC 115 ms
40,048 KB
testcase_03 AC 112 ms
41,352 KB
testcase_04 AC 105 ms
40,284 KB
testcase_05 AC 108 ms
40,224 KB
testcase_06 AC 97 ms
40,480 KB
testcase_07 AC 105 ms
40,132 KB
testcase_08 AC 113 ms
41,592 KB
testcase_09 AC 104 ms
41,100 KB
testcase_10 AC 111 ms
40,348 KB
testcase_11 AC 109 ms
41,120 KB
testcase_12 AC 101 ms
40,260 KB
testcase_13 AC 96 ms
40,696 KB
testcase_14 AC 103 ms
41,368 KB
testcase_15 AC 117 ms
41,156 KB
testcase_16 AC 105 ms
40,548 KB
testcase_17 AC 111 ms
41,000 KB
testcase_18 AC 108 ms
40,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no207;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		for(long x=a;x<=b;x++) {
			if (isAho(x)) {
				System.out.println(x);
			}
		}
	}

	public static boolean isAho(long n) {
		if (n % 3 == 0) {
			return true;
		}
		while(n > 0) {
			if (n % 10 == 3) {
				return true;
			}
			n/=10;
		}
		return false;
	}

}
0