結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2017-04-30 14:24:54 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 58 ms / 5,000 ms |
コード長 | 861 bytes |
コンパイル時間 | 11,331 ms |
コンパイル使用メモリ | 74,368 KB |
実行使用メモリ | 50,372 KB |
最終ジャッジ日時 | 2024-09-13 23:39:08 |
合計ジャッジ時間 | 4,112 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import static java.lang.System.in;public class Main {public static void main(String[] args) throws IOException {BufferedReader reader = new BufferedReader(new InputStreamReader(in));String[] inputs = reader.readLine().split(" ");long A = Long.parseLong(inputs[0]);long B = Long.parseLong(inputs[1]);for (long i = A; i <= B; i++) {if (i % 3 == 0 || containsThree(i)) {System.out.println(i);}}}private static boolean containsThree(long n) {String ns = String.valueOf(n);for (int i = 0; i < ns.length(); i++) {if (ns.charAt(i) == '3') {return true;}}return false;}}