Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- typedef long long ll;
- using namespace __gnu_pbds;
- using namespace std;
- #define pb push_back
- #define mp make_pair
- #define eb emplace_back
- #define ff first
- #define ss second
- #define len(v) ((int)v.size())
- #define all(v) v.begin(), v.end()
- #define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
- ll mod=998244353;
- void io(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- }
- const int N = 1e6 + 5;
- int main() {
- io();
- int t;
- cin>>t;
- assert(t <= 10);
- while(t--){
- int n;
- cin>>n;
- int a[n],f[n];
- memset(f,0,sizeof(f));
- for(int i=1;i<=n;i++){
- cin>>a[i];
- if(a[i] % 2 == 0)
- f[i] = 1;
- }
- for(int i=1;i<=n;i++){
- f[i] += f[i-1];
- }
- int q;
- cin>>q;
- while(q--){
- int l,r;
- cin>>l>>r;
- if(f[r] - f[l-1] >= 1)
- cout<<"EVEN\n";
- else
- cout<<"ODD\n";
- }
- }
- }
Add Comment
Please, Sign In to add comment