結果

問題 No.207 世界のなんとか
ユーザー k_kadora
提出日時 2015-06-10 22:05:28
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 3,359 ms
コンパイル使用メモリ 76,408 KB
実行使用メモリ 46,336 KB
最終ジャッジ日時 2024-10-09 10:23:13
合計ジャッジ時間 6,593 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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