結果

問題 No.207 世界のなんとか
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-02 12:06:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 605 bytes
コンパイル時間 3,904 ms
コンパイル使用メモリ 78,876 KB
実行使用メモリ 41,552 KB
最終ジャッジ日時 2024-04-20 06:46:33
合計ジャッジ時間 7,208 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,228 KB
testcase_01 AC 116 ms
40,080 KB
testcase_02 AC 124 ms
39,952 KB
testcase_03 AC 119 ms
39,920 KB
testcase_04 AC 115 ms
39,908 KB
testcase_05 AC 132 ms
41,220 KB
testcase_06 AC 127 ms
41,056 KB
testcase_07 AC 119 ms
39,932 KB
testcase_08 AC 109 ms
40,064 KB
testcase_09 AC 122 ms
40,488 KB
testcase_10 AC 122 ms
40,288 KB
testcase_11 AC 132 ms
41,188 KB
testcase_12 AC 116 ms
40,184 KB
testcase_13 AC 132 ms
41,552 KB
testcase_14 AC 120 ms
40,036 KB
testcase_15 AC 119 ms
40,272 KB
testcase_16 AC 118 ms
39,856 KB
testcase_17 AC 125 ms
41,256 KB
testcase_18 AC 112 ms
40,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.stream.IntStream;

// https://yukicoder.me/problems/no/07
public class WorldWhat207 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    // String 1つ分を読み込む
    int from = Integer.parseInt(sc.next());
    int to = Integer.parseInt(sc.next());
    IntStream.range(from, to + 1).filter(n -> ((n % 3 == 0) || contains3(n))).forEach(n -> System.out.println(n));
  }

  private static boolean contains3(int n) {
    return Integer.toString(n).contains("3");
  }
}
0