Created
March 19, 2023 17:11
-
-
Save qjatn0120/adcf7124f6896653a795a83eab34c3b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
cin.tie(nullptr), ios::sync_with_stdio(false); | |
int t; | |
cin >> t; | |
while(t--){ | |
int n, q; | |
cin >> n >> q; | |
vector <long long int> a(n + 1); | |
for(int i = 1; i <= n; i++){ | |
cin >> a[i]; | |
a[i] += a[i - 1]; | |
} | |
while(q--){ | |
int l, r; | |
long long int k; | |
cin >> l >> r >> k; | |
long long int sum = a[l - 1] + a[n] - a[r] + (r - l + 1) * k; | |
cout << ((sum & 1) ? "Yes\n" : "No\n"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment