Comments

The login is not working again :(

Is there a vscode version requirement? Mine is saying that the extension is incompatible with vscode version 1.81.1

One more suggestion: Can you display autocomplete for packages and methods available in languages?

So for example if I am trying to write upper_bound in C++, it automatically gets recommended to me via autocomplete.

Yeah I was able to add my own template thanks. One suggestion, could you display 'cerr'(or any error stream for that matter) messages? It would help in debugging. Currently they are not being displayed.

Is there a way that I can add my CF template to the editor that gets opened?

My O(n lg n) solution is failing, is it due to my CP template?

I would like to discuss, but I am restricting myself to 1800-1900 level problems. I'll become efficient in them, then I'll venture into more exotic problems.

I came up with the solution for C. Squaring by myself(mathematically at least) and realized it was failing due to the missing epsilon(eps) in the code. Why is this value required?

In question C, if we are able to reach till i + d + 1 using d operations then why aren't we taking the minimum till that index as well?

DP solution for problem C incase anybody needs it. I have used binary search to finally filter out the value. Incase any further explanation is required, feel free to ask, I'll try my best to explain

I just understood the solution(by proving it on pen and paper), so now I understand where I went wrong. Thanks :)

In B problem, I replaced 1 with 2 and all the other values I replaced with 1(the last element will be set in a way such that the sum remains the same), why doesn't this work?

In Div 2 problem B, can you prove that multiple from 1 to r — l + 1 statement Thanks

How can we use AVX instructions to solve 1851F?

In Problem D why are we only subtracting 1 from k after every iteration, shouldn't we take into account the fact that we are performing 4 * x number of operations and adjust k accordingly?

Hey man, how were you specifically able to come up with the a >= 2 * b condition. Can you please explain your thought process behind it?

Can someone please explain what does area to Vika mean? Is it something other that the number of blocks between Vika and one of her friends?

  1. What is the correct solution for problem C then, if it exists?
  2. In the editorial for problem E, it is mentioned that for g<L, ceil(L/g) will have O(sqrt(L)) values, how?

Will this approach work for "yabz"? Because for both the choices Alice has, she'll lose.

-8

We can use Segment trees to solve 987C in O(nlogn) time. 174709413

I tried using DP, but my solution gives the wrong answer. Can someone please tell me what I did wrong

#include<bits/stdc++.h>
#define ios                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
#define endl "\n"
#define int long long
#define YY cout<<"YES"<<endl
#define NN cout<<"NO"<<endl
#define yy cout<<"Yes"<<endl
#define nn cout<<"No"<<endl
using namespace std;
vector<vector<int>>mem;
bool solve(string &s,string &t);
bool solver(string &s,string &t,int i,int j);
signed main(){
    ios;
    int q;
    cin>>q;
    while(q--){
        string s,t;
        cin>>s>>t;
        bool ans=solve(s,t);
        (ans)?YY:NN;
    }
    return 0;
}
bool solve(string &s,string &t){
    mem=vector<vector<int>>(s.size(),vector<int>(t.size(),-1));
    for(int i=0;i<s.size();i++){
        if(solver(s,t,i,0)){
            return true;
        }
    }
    return false;
}
bool solver(string &s,string &t,int i,int j){
    if(j==t.size()){
        return true;
    } else if(i==s.size() or i<0){
        return false;
    } else if(mem[i][j]!=-1){
        return mem[i][j];
    } else {
        return mem[i][j]=(s[i]==t[j]) and (solver(s,t,i+1,j+1) or solver(s,t,i-1,j+1)); 
    }
}