結果

問題 No.207 世界のなんとか
ユーザー k_kadorak_kadora
提出日時 2015-06-10 22:05:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 3,228 ms
コンパイル使用メモリ 75,264 KB
実行使用メモリ 41,320 KB
最終ジャッジ日時 2024-04-17 16:16:01
合計ジャッジ時間 6,245 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
41,184 KB
testcase_01 AC 117 ms
41,188 KB
testcase_02 AC 112 ms
40,164 KB
testcase_03 AC 122 ms
40,436 KB
testcase_04 AC 119 ms
41,320 KB
testcase_05 AC 111 ms
40,444 KB
testcase_06 AC 117 ms
40,384 KB
testcase_07 AC 108 ms
39,820 KB
testcase_08 AC 108 ms
40,092 KB
testcase_09 AC 124 ms
41,308 KB
testcase_10 AC 127 ms
41,064 KB
testcase_11 AC 124 ms
40,376 KB
testcase_12 AC 125 ms
41,156 KB
testcase_13 AC 116 ms
40,036 KB
testcase_14 AC 115 ms
40,376 KB
testcase_15 AC 120 ms
40,888 KB
testcase_16 AC 116 ms
40,064 KB
testcase_17 AC 117 ms
40,380 KB
testcase_18 AC 107 ms
40,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
public class World{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		Long a,b,n,temp;
		ArrayList number = new ArrayList();
		a = sc.nextLong();
		b = sc.nextLong();
		n = b-a+1;
		for(int i =0;i<n;i++){
			temp = a+i;
			if(temp %3 == 0){
				number.add(temp);
			}else{
				while( temp > 0){
					if(temp % 10 == 3){
						number.add(a+i);
						break;
					}
					temp = temp / 10;
				}
			}
		}
		if(number.size() != 0){
			for(int i = 0;i<number.size();i++){
				System.out.println(number.get(i));
			}
		}
	}
}
0