結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2021-01-02 12:04:14 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 602 bytes |
コンパイル時間 | 3,588 ms |
コンパイル使用メモリ | 78,416 KB |
実行使用メモリ | 41,340 KB |
最終ジャッジ日時 | 2024-10-12 01:51:34 |
合計ジャッジ時間 | 6,842 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 11 |
ソースコード
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); } }