結果

問題 No.2155 みちらcolor
ユーザー CleyLCleyL
提出日時 2022-12-20 23:50:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 73,856 KB
実行使用メモリ 43,392 KB
最終ジャッジ日時 2024-04-29 03:01:48
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
40,192 KB
testcase_01 AC 20 ms
20,480 KB
testcase_02 AC 12 ms
13,184 KB
testcase_03 AC 17 ms
17,536 KB
testcase_04 AC 17 ms
17,024 KB
testcase_05 AC 30 ms
30,464 KB
testcase_06 AC 7 ms
8,576 KB
testcase_07 AC 5 ms
5,888 KB
testcase_08 AC 20 ms
20,864 KB
testcase_09 AC 25 ms
24,832 KB
testcase_10 AC 11 ms
12,288 KB
testcase_11 AC 10 ms
11,392 KB
testcase_12 AC 25 ms
24,832 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 28 ms
28,032 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 10 ms
11,136 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 22 ms
22,016 KB
testcase_19 AC 25 ms
25,344 KB
testcase_20 AC 38 ms
37,248 KB
testcase_21 AC 43 ms
41,728 KB
testcase_22 AC 29 ms
29,056 KB
testcase_23 AC 30 ms
30,336 KB
testcase_24 AC 43 ms
42,496 KB
testcase_25 AC 40 ms
39,424 KB
testcase_26 AC 37 ms
36,480 KB
testcase_27 AC 42 ms
40,960 KB
testcase_28 AC 35 ms
33,792 KB
testcase_29 AC 32 ms
31,744 KB
testcase_30 AC 30 ms
29,568 KB
testcase_31 AC 38 ms
37,248 KB
testcase_32 AC 35 ms
34,560 KB
testcase_33 AC 37 ms
36,608 KB
testcase_34 AC 38 ms
36,608 KB
testcase_35 AC 32 ms
30,976 KB
testcase_36 AC 36 ms
35,840 KB
testcase_37 AC 41 ms
40,960 KB
testcase_38 AC 30 ms
30,336 KB
testcase_39 AC 43 ms
43,136 KB
testcase_40 AC 45 ms
43,392 KB
testcase_41 AC 44 ms
43,392 KB
testcase_42 AC 44 ms
43,264 KB
testcase_43 AC 3 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 2 ms
5,376 KB
testcase_47 AC 3 ms
5,376 KB
testcase_48 AC 3 ms
5,376 KB
testcase_49 AC 2 ms
5,376 KB
testcase_50 AC 3 ms
5,376 KB
testcase_51 AC 3 ms
5,376 KB
testcase_52 AC 3 ms
5,376 KB
testcase_53 AC 3 ms
5,376 KB
testcase_54 AC 3 ms
5,376 KB
testcase_55 AC 3 ms
5,376 KB
testcase_56 AC 3 ms
5,376 KB
testcase_57 AC 2 ms
5,376 KB
testcase_58 AC 2 ms
5,376 KB
testcase_59 AC 2 ms
5,376 KB
testcase_60 AC 3 ms
5,376 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 3 ms
5,376 KB
testcase_63 AC 2 ms
5,376 KB
testcase_64 AC 2 ms
5,376 KB
testcase_65 AC 2 ms
5,376 KB
testcase_66 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int dp[101][103000];

int main(){
  int n,m,l;cin>>n>>m>>l;
  dp[0][l] = 1;
  vector<int> A(n);
  for(int i = 0; n > i; i++){
    cin>>A[i];
  }
  for(int i = 0; n > i; i++){
    for(int j = 0; 1000*(n+1) >= j; j++){
      dp[i+1][j] |= dp[i][j];
      dp[i+1][(j+A[i])/2] |= dp[i][j];
    }
  }
  for(int i = 0; n >= i; i++){
    if(dp[i][m]){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
0