Skip to content

Instantly share code, notes, and snippets.

@qjatn0120
Created March 19, 2023 17:11
Show Gist options
  • Save qjatn0120/adcf7124f6896653a795a83eab34c3b2 to your computer and use it in GitHub Desktop.
Save qjatn0120/adcf7124f6896653a795a83eab34c3b2 to your computer and use it in GitHub Desktop.
#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