結果

問題 No.207 世界のなんとか
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-02 12:04:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 79,292 KB
実行使用メモリ 55,056 KB
最終ジャッジ日時 2024-04-20 06:44:19
合計ジャッジ時間 6,015 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 108 ms
53,924 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 112 ms
53,448 KB
testcase_07 AC 114 ms
54,092 KB
testcase_08 AC 122 ms
54,400 KB
testcase_09 AC 100 ms
52,928 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 100 ms
52,764 KB
testcase_17 AC 96 ms
52,620 KB
testcase_18 AC 101 ms
52,940 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 (n / 10 == 3) || (n % 10 == 3);
  }
}
0