結果

問題 No.2155 みちらcolor
ユーザー viral8viral8
提出日時 2022-12-09 21:58:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 2,491 ms
コンパイル使用メモリ 74,544 KB
実行使用メモリ 54,860 KB
最終ジャッジ日時 2024-04-22 22:07:09
合計ジャッジ時間 13,639 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
54,140 KB
testcase_01 AC 145 ms
54,276 KB
testcase_02 AC 140 ms
53,972 KB
testcase_03 AC 145 ms
54,144 KB
testcase_04 AC 146 ms
54,456 KB
testcase_05 AC 147 ms
54,172 KB
testcase_06 AC 140 ms
54,744 KB
testcase_07 AC 137 ms
54,188 KB
testcase_08 AC 148 ms
54,248 KB
testcase_09 AC 150 ms
53,996 KB
testcase_10 AC 143 ms
54,132 KB
testcase_11 AC 144 ms
54,044 KB
testcase_12 AC 148 ms
54,188 KB
testcase_13 AC 133 ms
53,904 KB
testcase_14 AC 148 ms
53,924 KB
testcase_15 AC 142 ms
54,040 KB
testcase_16 AC 142 ms
54,220 KB
testcase_17 AC 134 ms
53,980 KB
testcase_18 AC 146 ms
54,200 KB
testcase_19 AC 147 ms
54,044 KB
testcase_20 AC 156 ms
54,328 KB
testcase_21 AC 153 ms
54,092 KB
testcase_22 AC 147 ms
53,944 KB
testcase_23 AC 151 ms
54,192 KB
testcase_24 AC 149 ms
53,968 KB
testcase_25 AC 148 ms
54,136 KB
testcase_26 AC 154 ms
54,060 KB
testcase_27 AC 152 ms
54,180 KB
testcase_28 AC 149 ms
54,216 KB
testcase_29 AC 149 ms
53,844 KB
testcase_30 AC 148 ms
54,428 KB
testcase_31 AC 147 ms
54,020 KB
testcase_32 AC 146 ms
54,004 KB
testcase_33 AC 149 ms
54,228 KB
testcase_34 AC 148 ms
54,208 KB
testcase_35 AC 154 ms
54,084 KB
testcase_36 AC 149 ms
54,092 KB
testcase_37 AC 150 ms
54,084 KB
testcase_38 AC 147 ms
54,128 KB
testcase_39 AC 151 ms
54,144 KB
testcase_40 AC 145 ms
53,956 KB
testcase_41 AC 149 ms
54,236 KB
testcase_42 AC 150 ms
54,268 KB
testcase_43 AC 135 ms
54,196 KB
testcase_44 AC 135 ms
53,984 KB
testcase_45 AC 136 ms
53,776 KB
testcase_46 AC 135 ms
54,252 KB
testcase_47 AC 136 ms
54,160 KB
testcase_48 AC 138 ms
54,376 KB
testcase_49 AC 135 ms
54,076 KB
testcase_50 AC 138 ms
54,248 KB
testcase_51 AC 135 ms
54,084 KB
testcase_52 AC 137 ms
54,860 KB
testcase_53 AC 136 ms
54,076 KB
testcase_54 AC 136 ms
53,916 KB
testcase_55 AC 133 ms
54,392 KB
testcase_56 AC 136 ms
54,304 KB
testcase_57 AC 136 ms
54,124 KB
testcase_58 AC 138 ms
54,200 KB
testcase_59 AC 134 ms
53,936 KB
testcase_60 AC 133 ms
54,104 KB
testcase_61 AC 133 ms
53,860 KB
testcase_62 AC 133 ms
54,292 KB
testcase_63 AC 136 ms
54,376 KB
testcase_64 AC 135 ms
53,928 KB
testcase_65 AC 134 ms
54,088 KB
testcase_66 AC 131 ms
53,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int L = sc.nextInt();
		boolean[] dp = new boolean[1001];
		dp[L] = true;
		while(N-->0){
			boolean[] next = new boolean[1001];
			int A = sc.nextInt();
			for(int i=0;i<=1000;i++){
				next[i] |= dp[i];
				next[(i+A)/2] |= dp[i];
			}
			dp = next;
		}
		System.out.println(dp[M]?"Yes":"No");
	}
}
0