結果

問題 No.207 世界のなんとか
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-22 09:32:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 5,000 ms
コード長 432 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 74,424 KB
実行使用メモリ 41,880 KB
最終ジャッジ日時 2024-04-10 08:20:00
合計ジャッジ時間 5,606 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,532 KB
testcase_01 AC 137 ms
41,144 KB
testcase_02 AC 139 ms
41,556 KB
testcase_03 AC 136 ms
41,268 KB
testcase_04 AC 135 ms
41,544 KB
testcase_05 AC 137 ms
41,320 KB
testcase_06 AC 130 ms
41,620 KB
testcase_07 AC 131 ms
41,468 KB
testcase_08 AC 134 ms
41,688 KB
testcase_09 AC 135 ms
41,692 KB
testcase_10 AC 136 ms
41,044 KB
testcase_11 AC 137 ms
41,728 KB
testcase_12 AC 137 ms
41,488 KB
testcase_13 AC 134 ms
41,560 KB
testcase_14 AC 142 ms
41,872 KB
testcase_15 AC 147 ms
41,392 KB
testcase_16 AC 132 ms
41,364 KB
testcase_17 AC 133 ms
41,880 KB
testcase_18 AC 130 ms
41,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      int count = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) == '3') count++;
      }
      if((i % 3 == 0) || (count > 0)) System.out.println(i);
    }
  }
}
0