Comments
On cryCodeforces Round 1003 (Div. 4), 15 months ago
0

305337533

can anyone say me why this doesnt work for C1?? if i run it in vs code it passes the testcases but when i submitted it is showing runtime error.

On nifesheCodeforces Round 997 (Div. 2), 15 months ago
0

segment tree ahh! mb i did something like this:

for (int i = 0; i < n; ++i) {
        for(int j=i;j<n;j++){
            if ((j - i + 1) % 2 != 0){
                ans++;
                continue;
            }
            vector<int> b;
            for(int k=i;k<=j;k++){
                b.push_back(a[k]);
            }
            sort(b.begin(),b.end());
            if(b[(j-i)/2] == b[(j-i)/2 + 1]){
                ans++;
            }
        }
    }

for this time limit exceeds obv(im a newbie). i tried to implement it with freq array(as a<=10) to optimize it but still time limit exceeded.

On nifesheCodeforces Round 997 (Div. 2), 15 months ago
0

In that case, if we sort each and every subarray, doesn't the time limit get exceeded?

On nifesheCodeforces Round 997 (Div. 2), 15 months ago
0

tf is problem B?? problem D: wow small question(length wise) lets try it, tried it and was able to solve it in first attempt with time compl of O(n^3logn),optimized it and submitted still time limit exceeded.