#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
long long start = max(1LL, n - k + 1);
long long end = n;
long long oddCount = 0;
if (start % 2 == 1) {
oddCount = (end - start) / 2 + 1;
} else {
oddCount = (end - start + 1) / 2;
}
if (oddCount % 2 == 0) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
B solution
Master card 1 and 2 both done ✅ ping me
🔥🔥🔥
Master card 1 and 2 both done ✅ ping me🔥🔥🔥
🔥🔥🔥Master card 1 and 2 both done ✅ ping me🔥🔥🔥
ANYONE NEEDED
CF EXPERT
CF EXPERT ACCOUNT FOR SELLЧитать полностью…
ANYONE NEEDED CODECHEF 5 ⭐
ID DMM ME.(ONLY SERIOUS BUYER MSG ME)
ANYONE NEEDED CODECHEF 5 ⭐
ID DMM ME
#include<bits/stdc++.h>
using namespace std;
void solve(){
int total_remaining=0;
int n,k;
int ans=0;
cin>>n>>k;
vector<int>a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
if(a[i]>=k){
total_remaining+=a[i];
}
else if(a[i]==0 && total_remaining>0){
total_remaining--;
ans++;
}
}
cout<<ans<<endl;
}
int main(){
int t;cin>>t;
while(t--){
solve();
}
}
A solution just go 1 to n in array and if a[i] >= k robin += a[i] else if a[i] == 0 count++ robin - - and at last cout « count « endl
Читать полностью…I need help for online assesment
For zscalar company can you help me question will from dp,graph
ANYONE NEEDED
CF EXPERT
CF EXPERT ACCOUNT FOR SELLЧитать полностью…