結果

問題 No.207 世界のなんとか
ユーザー barrett114514barrett114514
提出日時 2017-07-23 20:23:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 623 bytes
コンパイル時間 3,094 ms
コンパイル使用メモリ 75,032 KB
実行使用メモリ 41,592 KB
最終ジャッジ日時 2024-04-17 16:56:14
合計ジャッジ時間 6,125 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,148 KB
testcase_01 AC 120 ms
41,472 KB
testcase_02 AC 126 ms
41,456 KB
testcase_03 AC 109 ms
41,296 KB
testcase_04 AC 109 ms
40,940 KB
testcase_05 AC 125 ms
41,304 KB
testcase_06 AC 121 ms
41,500 KB
testcase_07 AC 108 ms
41,304 KB
testcase_08 AC 125 ms
41,432 KB
testcase_09 AC 128 ms
41,384 KB
testcase_10 AC 126 ms
41,096 KB
testcase_11 AC 115 ms
41,248 KB
testcase_12 AC 130 ms
41,184 KB
testcase_13 AC 128 ms
41,148 KB
testcase_14 AC 129 ms
41,140 KB
testcase_15 AC 129 ms
41,084 KB
testcase_16 AC 123 ms
41,448 KB
testcase_17 AC 126 ms
41,592 KB
testcase_18 AC 122 ms
41,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class WorldOfNabeatsu {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int E = B - A + 1;
		int[] L = new int[E];
		int[] temporaryStorage = new int[E];
		
		for(int i = 0;i < E;i ++){
			L[i] = A;
			A ++;
		}
		
		String[] str = new String[E];
		
		for(int i = 0;i < E;i ++){
			str[i] = String.valueOf(L[i]);
		}
		
		for(int i = 0; i < E ; i++){
			if(L[i] % 3 == 0){
				System.out.println(L[i]);
				
			}else if(str[i].indexOf("3") >= 0){
				System.out.println(L[i]);
				
			}
			
		}
		
	}
	
}
0