結果
問題 | No.207 世界のなんとか |
ユーザー | ayumu |
提出日時 | 2016-05-14 13:42:03 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 59 ms / 5,000 ms |
コード長 | 808 bytes |
コンパイル時間 | 3,569 ms |
コンパイル使用メモリ | 75,704 KB |
実行使用メモリ | 37,216 KB |
最終ジャッジ日時 | 2024-04-17 16:46:54 |
合計ジャッジ時間 | 4,918 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 54 ms
37,168 KB |
testcase_01 | AC | 54 ms
37,016 KB |
testcase_02 | AC | 55 ms
37,020 KB |
testcase_03 | AC | 52 ms
37,204 KB |
testcase_04 | AC | 53 ms
36,976 KB |
testcase_05 | AC | 54 ms
37,136 KB |
testcase_06 | AC | 58 ms
37,048 KB |
testcase_07 | AC | 52 ms
36,864 KB |
testcase_08 | AC | 59 ms
37,016 KB |
testcase_09 | AC | 53 ms
36,520 KB |
testcase_10 | AC | 54 ms
37,056 KB |
testcase_11 | AC | 54 ms
37,216 KB |
testcase_12 | AC | 54 ms
37,140 KB |
testcase_13 | AC | 55 ms
37,136 KB |
testcase_14 | AC | 55 ms
37,084 KB |
testcase_15 | AC | 56 ms
36,864 KB |
testcase_16 | AC | 53 ms
37,148 KB |
testcase_17 | AC | 51 ms
36,880 KB |
testcase_18 | AC | 54 ms
36,816 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class SampleInput { public static void main(String[] args) { String s =""; try{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); s = br.readLine(); }catch(IOException e){ e.printStackTrace(); } String aS = s.substring(0,s.indexOf(" ")); String bS = s.substring(s.indexOf(" ")+1); long a=0; long b=0; try{ a = Long.parseLong(aS); b = Long.parseLong(bS); }catch(NumberFormatException e){ e.printStackTrace(); } for(Long n = a; n <= b;n++){ if(n % 3 == 0){ System.out.println(n); } else{ String nS = ""+n; if(nS.indexOf("3") >= 0){ System.out.println(n); } } } } }