結果

問題 No.207 世界のなんとか
ユーザー core123core123
提出日時 2019-04-16 15:27:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 74,984 KB
実行使用メモリ 57,644 KB
最終ジャッジ日時 2023-10-22 07:04:50
合計ジャッジ時間 5,692 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,364 KB
testcase_01 AC 135 ms
57,448 KB
testcase_02 AC 142 ms
57,628 KB
testcase_03 AC 137 ms
57,496 KB
testcase_04 AC 137 ms
57,492 KB
testcase_05 AC 142 ms
57,596 KB
testcase_06 AC 137 ms
57,496 KB
testcase_07 AC 132 ms
57,452 KB
testcase_08 AC 137 ms
57,516 KB
testcase_09 AC 141 ms
57,644 KB
testcase_10 AC 143 ms
57,452 KB
testcase_11 AC 140 ms
57,496 KB
testcase_12 AC 142 ms
57,456 KB
testcase_13 AC 139 ms
57,628 KB
testcase_14 AC 142 ms
57,596 KB
testcase_15 AC 142 ms
57,516 KB
testcase_16 AC 141 ms
57,456 KB
testcase_17 AC 137 ms
57,484 KB
testcase_18 AC 135 ms
57,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.*;
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 i=a;i<=b;i++){
			if(i%3==0||isAttached3(i)){
				System.out.println(i);
			}
		}
	}
	public static boolean isAttached3(long x){
		String s=Long.toString(x);
		for(char c:s.toCharArray()){
			if(c=='3')return true;
		}
		return false;
	}
}
0