Submission #59208719


Source Code Expand

#include <bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using namespace atcoder;
#define all(a) a.begin(),a.end()
#define cmp(a) sort(all(a));a.erase(unique(all(a)),a.end())
typedef long long ll;
typedef pair<ll,ll> P;
typedef modint1000000007 mi;
constexpr ll mod=1000000007;

ll a[1005],b[1005];

int main(){
	ll n,k;cin>>n>>k;
	ll sum=0;
	rep(i,n)cin>>a[i];
	rep(i,n)cin>>b[i];
	rep(i,n)sum+=abs(a[i]-b[i]);
	if(sum<=k&&sum%2==k%2)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Submission Info

Submission Time
Task 024 - Select +/- One(★2)
User Rho17
Language C++ 20 (gcc 12.2)
Score 2
Code Size 552 Byte
Status AC
Exec Time 1 ms
Memory 3612 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 2 / 2
Status
AC × 3
AC × 23
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 10_hand_01.txt, 10_hand_02.txt, 10_hand_03.txt, 20_a_equal_b_no.txt, 20_a_equal_b_yes.txt, 50_small_gap_01.txt, 50_small_gap_02.txt, 50_small_gap_03.txt, 50_small_gap_04.txt, 50_small_gap_05.txt, 80_random_small_01.txt, 80_random_small_02.txt, 80_random_small_03.txt, 80_random_small_04.txt, 80_random_small_05.txt, 90_random_large_01.txt, 90_random_large_02.txt, 90_random_large_03.txt, 90_random_large_04.txt, 90_random_large_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3508 KiB
00_sample_02.txt AC 1 ms 3472 KiB
00_sample_03.txt AC 1 ms 3500 KiB
10_hand_01.txt AC 1 ms 3480 KiB
10_hand_02.txt AC 1 ms 3604 KiB
10_hand_03.txt AC 1 ms 3508 KiB
20_a_equal_b_no.txt AC 1 ms 3500 KiB
20_a_equal_b_yes.txt AC 1 ms 3500 KiB
50_small_gap_01.txt AC 1 ms 3516 KiB
50_small_gap_02.txt AC 1 ms 3500 KiB
50_small_gap_03.txt AC 1 ms 3504 KiB
50_small_gap_04.txt AC 1 ms 3552 KiB
50_small_gap_05.txt AC 1 ms 3544 KiB
80_random_small_01.txt AC 1 ms 3516 KiB
80_random_small_02.txt AC 1 ms 3484 KiB
80_random_small_03.txt AC 1 ms 3540 KiB
80_random_small_04.txt AC 1 ms 3496 KiB
80_random_small_05.txt AC 1 ms 3540 KiB
90_random_large_01.txt AC 1 ms 3612 KiB
90_random_large_02.txt AC 1 ms 3412 KiB
90_random_large_03.txt AC 1 ms 3584 KiB
90_random_large_04.txt AC 1 ms 3540 KiB
90_random_large_05.txt AC 1 ms 3424 KiB