結果

問題 No.207 世界のなんとか
ユーザー ayumuayumu
提出日時 2016-05-14 13:45:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 3,974 ms
コンパイル使用メモリ 74,856 KB
実行使用メモリ 50,432 KB
最終ジャッジ日時 2024-04-17 16:47:09
合計ジャッジ時間 4,015 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
50,052 KB
testcase_01 AC 43 ms
50,212 KB
testcase_02 AC 45 ms
50,272 KB
testcase_03 AC 44 ms
49,992 KB
testcase_04 AC 43 ms
49,904 KB
testcase_05 AC 44 ms
50,116 KB
testcase_06 AC 44 ms
50,280 KB
testcase_07 AC 42 ms
50,404 KB
testcase_08 AC 43 ms
49,868 KB
testcase_09 AC 44 ms
50,232 KB
testcase_10 AC 46 ms
50,248 KB
testcase_11 AC 45 ms
50,280 KB
testcase_12 AC 45 ms
50,384 KB
testcase_13 AC 46 ms
50,328 KB
testcase_14 AC 46 ms
49,980 KB
testcase_15 AC 45 ms
50,228 KB
testcase_16 AC 43 ms
50,432 KB
testcase_17 AC 43 ms
50,068 KB
testcase_18 AC 42 ms
50,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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;
		
		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 = String.valueOf(n);
				if(nS.indexOf("3") >= 0){
					System.out.println(n);
				}
			}
		}
	}
}
0