結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2015-12-31 23:19:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 129 ms / 5,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 2,573 ms |
コンパイル使用メモリ | 76,028 KB |
実行使用メモリ | 41,532 KB |
最終ジャッジ日時 | 2024-10-09 10:41:38 |
合計ジャッジ時間 | 5,411 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.util.*;class Test {public static void main(String[] args) {Scanner in = new Scanner(System.in);String str1 = in.next();String str2 = in.next();int x = Integer.parseInt(str1);int y = Integer.parseInt(str2);int ans = 0;ArrayList<Integer> thList = new ArrayList<>();for(int i = x; i <= y; i++) {if(i % 3 == 0) {thList.add(i);ans++;} else if(String.valueOf(i).contains("3")) {thList.add(i);ans++;}}for(int i = 0; i < ans; i++) {System.out.println(thList.get(i));}}}