結果

問題 No.1538 引きこもりさんは引き算が得意。
ユーザー hiro71687khiro71687k
提出日時 2023-03-30 19:57:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 696 bytes
コンパイル時間 4,551 ms
コンパイル使用メモリ 271,708 KB
実行使用メモリ 334,444 KB
最終ジャッジ日時 2023-10-22 04:34:11
合計ジャッジ時間 26,547 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
11,360 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 WA -
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 TLE -
testcase_38 TLE -
testcase_39 AC 1,075 ms
134,756 KB
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 AC 8 ms
4,348 KB
testcase_44 AC 1,672 ms
167,524 KB
testcase_45 TLE -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=1000000007;
ll inf=9999999999999999;
int main(){
    ll n,k;
    cin >> n >> k;
    vector<ll>a(n);
    for (ll i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    map<ll,ll>memo;
    for (ll i = 0; i < n; i++)
    {
        map<ll,ll>dp;
        for(auto v:memo){
            dp[v.first]+=1;
            dp[v.first-a[i]]+=1;
            dp[a[i]-v.first]+=1;
        }
        dp[a[i]]+=1;
        memo=dp;
    }
    if (memo[k]>=1)
    {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}
0