結果
問題 |
No.2155 みちらcolor
|
ユーザー |
|
提出日時 | 2022-12-09 21:57:41 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 468 bytes |
コンパイル時間 | 2,884 ms |
コンパイル使用メモリ | 74,856 KB |
実行使用メモリ | 41,664 KB |
最終ジャッジ日時 | 2024-10-14 21:51:58 |
合計ジャッジ時間 | 13,043 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 59 WA * 5 |
ソースコード
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[0] = 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"); } }