結果

問題 No.207 世界のなんとか
ユーザー marumaru
提出日時 2017-09-24 08:33:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 493 bytes
コンパイル時間 3,550 ms
コンパイル使用メモリ 74,476 KB
実行使用メモリ 41,928 KB
最終ジャッジ日時 2024-04-26 17:21:53
合計ジャッジ時間 6,707 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,408 KB
testcase_01 AC 127 ms
41,648 KB
testcase_02 AC 135 ms
41,608 KB
testcase_03 AC 132 ms
41,372 KB
testcase_04 AC 128 ms
41,492 KB
testcase_05 AC 120 ms
40,528 KB
testcase_06 AC 128 ms
41,256 KB
testcase_07 AC 117 ms
40,352 KB
testcase_08 AC 115 ms
40,092 KB
testcase_09 AC 131 ms
41,360 KB
testcase_10 AC 120 ms
40,464 KB
testcase_11 AC 132 ms
41,716 KB
testcase_12 AC 133 ms
41,080 KB
testcase_13 AC 141 ms
41,380 KB
testcase_14 AC 137 ms
41,928 KB
testcase_15 AC 132 ms
41,576 KB
testcase_16 AC 112 ms
40,020 KB
testcase_17 AC 113 ms
40,436 KB
testcase_18 AC 112 ms
40,020 KB
権限があれば一括ダウンロードができます

ソースコード

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