結果

問題 No.207 世界のなんとか
ユーザー ayumuayumu
提出日時 2016-05-14 18:27:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 980 bytes
コンパイル時間 2,841 ms
コンパイル使用メモリ 75,068 KB
実行使用メモリ 37,216 KB
最終ジャッジ日時 2024-04-17 16:48:39
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
36,652 KB
testcase_01 AC 47 ms
36,932 KB
testcase_02 AC 49 ms
36,920 KB
testcase_03 AC 49 ms
37,020 KB
testcase_04 AC 49 ms
36,920 KB
testcase_05 AC 49 ms
36,832 KB
testcase_06 AC 50 ms
36,652 KB
testcase_07 AC 49 ms
36,968 KB
testcase_08 AC 48 ms
37,152 KB
testcase_09 AC 50 ms
36,968 KB
testcase_10 AC 49 ms
36,984 KB
testcase_11 AC 48 ms
36,668 KB
testcase_12 AC 54 ms
37,216 KB
testcase_13 AC 51 ms
37,168 KB
testcase_14 AC 50 ms
36,916 KB
testcase_15 AC 50 ms
36,752 KB
testcase_16 AC 49 ms
37,060 KB
testcase_17 AC 49 ms
36,780 KB
testcase_18 AC 48 ms
36,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No207 {
    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;
        
        a = Long.parseLong(aS);
        b = Long.parseLong(bS);
        for(Long n = a; n <= b;n++){
            if(n % 3 == 0){
                System.out.println(n);
            }
            else{
                String nS= Long.toString(n);
                if(nS.indexOf("3") >= 0){
                    System.out.println(n);
                }
            }
        }
    }
}
0