Codeforces Round 945 (Div. 2) || Editorial for Problem A,B,C
HTML-код
- Опубликовано: 16 май 2024
- A. Chess For Three || B. Cat, Fox and the Lonely Array || C. Cat, Fox and Double Maximum
contest URL: codeforces.com/contest/1973
Contact me:-
LinkedIn - / swapnil-tayal-53a5b4221
Instagram - / swapnil_tayal
#codeforces #cp #cpp #educational #EducationalCodeforces #div2 #codeforcessolutions #editorial #educational #Codeforces945 #945
Thank you for solving division 2 problems. Praying we can do division 1 one day 🙇♂️
Mic on the pen 🖊️....nice effort bro
Nice Explanation bro.
Thank you 🙂
bhai how did you get the intution of the fact that ans of k is monotonic ?
I didn't understand the context of K begin monotonic here
B solution:
void opr(vi &val, int x, int g){
int i = 0;
while(x > 0){
if(g) val[i] += (x%2);
else val[i] -= (x%2);
x /= 2;
i++;
}
}
bool f(vi &arr, int n, int k) {
int i = 0;
int j = 0;
vector val(64, 0);
set st;
while(j < n){
opr(val, arr[j], 1);
if(j-i+1 < k){
j++;
}else{
vector newVal;
for(auto &k: val){
if(k) newVal.pb(1);
else newVal.pb(0);
}
st.insert(newVal);
opr(val, arr[i], 0);
i++;
j++;
}
}
return (st.size() == 1);
}
void solve(){
int n;
cin >> n;
vi arr(n);
forn(i,0,n) cin>>arr[i];
int l = 1;
int r = n;
int ans = n;
// cout
was problem a bit harder than usual?
A was 😂, B and C was fine I guess
problem A?
B and C took 30min plus time so I remove it 🥲