結果

問題 No.207 世界のなんとか
ユーザー kurobei72kurobei72
提出日時 2018-01-19 14:02:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 5,000 ms
コード長 926 bytes
コンパイル時間 4,508 ms
コンパイル使用メモリ 72,584 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2023-08-25 23:57:18
合計ジャッジ時間 5,945 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,540 KB
testcase_01 AC 128 ms
55,556 KB
testcase_02 AC 141 ms
55,724 KB
testcase_03 AC 135 ms
55,560 KB
testcase_04 AC 132 ms
55,624 KB
testcase_05 AC 139 ms
55,976 KB
testcase_06 AC 128 ms
55,788 KB
testcase_07 AC 128 ms
55,480 KB
testcase_08 AC 129 ms
55,976 KB
testcase_09 AC 137 ms
55,980 KB
testcase_10 AC 139 ms
55,924 KB
testcase_11 AC 139 ms
55,632 KB
testcase_12 AC 142 ms
55,928 KB
testcase_13 AC 140 ms
55,528 KB
testcase_14 AC 156 ms
56,396 KB
testcase_15 AC 138 ms
56,016 KB
testcase_16 AC 130 ms
55,708 KB
testcase_17 AC 127 ms
55,464 KB
testcase_18 AC 126 ms
55,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.lang.String;
import java.lang.Integer;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Integer a = sc.nextInt();
        Integer b = sc.nextInt();
        
        for (int i = a; i <= b; i++) {
            boolean flag = false;
            int sum = 0;
            String[] aStr = a.toString().split("");
            for (int j = 0; j < aStr.length; j++) {
                int aInt = Integer.parseInt(aStr[j]);
                if (aInt == 3){
                    flag = true;
                }
                sum += aInt; 
            }
            if (!flag) {
                if (sum%3 == 0){
                    flag = true;
                }
            }
            if (flag){
                System.out.println(i);
            }
            a++;
        }
    }
}
0