結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
36,772 KB
testcase_01 AC 43 ms
36,732 KB
testcase_02 AC 45 ms
36,900 KB
testcase_03 AC 44 ms
36,708 KB
testcase_04 AC 43 ms
36,964 KB
testcase_05 AC 45 ms
37,036 KB
testcase_06 AC 44 ms
36,388 KB
testcase_07 AC 45 ms
36,396 KB
testcase_08 AC 44 ms
36,408 KB
testcase_09 AC 44 ms
36,380 KB
testcase_10 AC 44 ms
36,964 KB
testcase_11 AC 45 ms
36,668 KB
testcase_12 AC 45 ms
36,508 KB
testcase_13 AC 45 ms
36,844 KB
testcase_14 AC 45 ms
36,952 KB
testcase_15 AC 45 ms
37,248 KB
testcase_16 AC 43 ms
37,212 KB
testcase_17 AC 42 ms
37,096 KB
testcase_18 AC 41 ms
36,656 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= Long.toString(n);
				if(nS.indexOf("3") >= 0){
					System.out.println(n);
				}
			}
		}
	}
}
0