Submission #52434817
Source Code Expand
// LUOGU_RID: 156029572
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
//#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
bitset<30001> B,tmp;
signed main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n,x;cin>>n>>x;
B[0]=1;
for(int i=0;i<n;i++){
int a,b;cin>>a>>b;
tmp=B;
B=(tmp<<a)|(tmp<<b);
}
if(B[x]) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Jumping Takahashi |
| User | gangbengr |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 669 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 3632 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 1 ms | 3592 KiB |
| example_01.txt | AC | 1 ms | 3548 KiB |
| example_02.txt | AC | 1 ms | 3460 KiB |
| test_00.txt | AC | 1 ms | 3544 KiB |
| test_01.txt | AC | 1 ms | 3528 KiB |
| test_02.txt | AC | 1 ms | 3460 KiB |
| test_03.txt | AC | 2 ms | 3536 KiB |
| test_04.txt | AC | 1 ms | 3532 KiB |
| test_05.txt | AC | 1 ms | 3532 KiB |
| test_06.txt | AC | 1 ms | 3440 KiB |
| test_07.txt | AC | 1 ms | 3544 KiB |
| test_08.txt | AC | 1 ms | 3460 KiB |
| test_09.txt | AC | 1 ms | 3600 KiB |
| test_10.txt | AC | 1 ms | 3632 KiB |
| test_11.txt | AC | 1 ms | 3424 KiB |
| test_12.txt | AC | 1 ms | 3544 KiB |
| test_13.txt | AC | 1 ms | 3444 KiB |
| test_14.txt | AC | 1 ms | 3448 KiB |