結果

問題 No.207 世界のなんとか
ユーザー dazydazy
提出日時 2016-09-01 23:19:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 841 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 74,532 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-04-27 14:30:20
合計ジャッジ時間 5,046 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,160 KB
testcase_01 AC 112 ms
41,540 KB
testcase_02 AC 102 ms
39,876 KB
testcase_03 AC 109 ms
40,820 KB
testcase_04 AC 108 ms
41,296 KB
testcase_05 AC 112 ms
40,828 KB
testcase_06 AC 109 ms
40,844 KB
testcase_07 AC 111 ms
41,408 KB
testcase_08 AC 106 ms
40,920 KB
testcase_09 AC 97 ms
39,720 KB
testcase_10 AC 110 ms
41,160 KB
testcase_11 AC 113 ms
40,964 KB
testcase_12 AC 113 ms
41,000 KB
testcase_13 AC 105 ms
40,320 KB
testcase_14 AC 115 ms
41,088 KB
testcase_15 AC 114 ms
40,848 KB
testcase_16 AC 104 ms
40,652 KB
testcase_17 AC 106 ms
41,212 KB
testcase_18 AC 96 ms
39,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Yukicoder {
    static public void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int A = scanner.nextInt();
        int B = scanner.nextInt();
        int dif = B - A;

        if (A < 1 || B < 1 || A > 2000000000 || B > 2000000000 || dif < 0 || dif > 99) System.exit(1);

        int tmp;
        for (int i = 0; i <= dif; i++) {
            if (A%3 == 0) {
                System.out.println(A);
            } else {
                tmp = A;
                for (int j = 0; j < 10; j++) {
                    if (tmp%10 == 3){
                        System.out.println(A);
                        break;
                    }

                    tmp = tmp/10;

                    if (tmp == 0) break;
                }
            }
            A++;
        }
    }
}
0