結果

問題 No.207 世界のなんとか
ユーザー matsuyoshi30matsuyoshi30
提出日時 2015-12-31 23:19:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 106 ms / 5,000 ms
コード長 706 bytes
コンパイル時間 2,451 ms
コンパイル使用メモリ 75,552 KB
実行使用メモリ 41,716 KB
最終ジャッジ日時 2024-04-17 16:34:07
合計ジャッジ時間 4,421 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
40,308 KB
testcase_01 AC 104 ms
41,396 KB
testcase_02 AC 104 ms
41,568 KB
testcase_03 AC 101 ms
41,456 KB
testcase_04 AC 103 ms
41,652 KB
testcase_05 AC 93 ms
41,352 KB
testcase_06 AC 103 ms
41,380 KB
testcase_07 AC 92 ms
41,112 KB
testcase_08 AC 99 ms
41,228 KB
testcase_09 AC 94 ms
41,716 KB
testcase_10 AC 96 ms
41,284 KB
testcase_11 AC 106 ms
41,656 KB
testcase_12 AC 101 ms
41,272 KB
testcase_13 AC 103 ms
41,396 KB
testcase_14 AC 104 ms
41,288 KB
testcase_15 AC 105 ms
41,400 KB
testcase_16 AC 88 ms
41,520 KB
testcase_17 AC 98 ms
41,156 KB
testcase_18 AC 90 ms
41,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str1 = in.next();
        String str2 = in.next();
        int x = Integer.parseInt(str1);
        int y = Integer.parseInt(str2);

        int ans = 0;
        ArrayList<Integer> thList = new ArrayList<>();
        for(int i = x; i <= y; i++) {
            if(i % 3 == 0) {
                thList.add(i);
                ans++;
            } else if(String.valueOf(i).contains("3")) {
                thList.add(i);
                ans++;
            }
        }
        for(int i = 0; i < ans; i++) {
            System.out.println(thList.get(i));
        }
    }
}
0