結果

問題 No.207 世界のなんとか
ユーザー maru
提出日時 2017-09-24 08:33:17
言語 Java
(openjdk 23)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 493 bytes
コンパイル時間 4,690 ms
コンパイル使用メモリ 75,012 KB
実行使用メモリ 54,228 KB
最終ジャッジ日時 2024-11-14 06:52:22
合計ジャッジ時間 7,155 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;

public class Sekaino {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int from = scan.nextInt();
		int to = scan.nextInt();
		Set<Integer> threeList = new LinkedHashSet<Integer>();
		for (int i = from; i <= to; i++) {
			if (i % 3 == 0 || String.valueOf(i).contains("3")) {
				threeList.add(i);
			}
		}
		for (int num : threeList) {
			System.out.println(num);
		}

	}

}
0