結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2018-05-20 11:46:34 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 140 ms / 5,000 ms |
コード長 | 618 bytes |
コンパイル時間 | 1,979 ms |
コンパイル使用メモリ | 74,020 KB |
実行使用メモリ | 41,968 KB |
最終ジャッジ日時 | 2024-06-28 14:35:56 |
合計ジャッジ時間 | 5,332 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int start=sc.nextInt(); int end=sc.nextInt(); for(int i=start;i<=end;i++) { if(isAho(i)) { System.out.println(i); } } sc.close(); } public static boolean isAho(int n) { if(n%3==0) { return true; } return containTree(n); } public static boolean containTree(int n) { while(n>0) { if(n%10==3) { return true; } n/=10; } return false; } }