solution link
I used segment tree for this question but I am getting tle please help me out or I shall move on to BIT or fenwick tree
I also used policy based data structures and again got TLE solution link.
solution link
solution link
I used segment tree for this question but I am getting tle please help me out or I shall move on to BIT or fenwick tree
I also used policy based data structures and again got TLE solution link.
solution link
rectified myself fast IO were the issues. with my policy based data structures approach but still not getting why segment tree gave TLE.
Using 26 segment trees , right ? I guess most of the people didn’t use segment tree, though my only idea was segment tree.
ya brother but policy based data structures were enough for this question my second soluton passed
Can anybody give a test-case where my solution fails for this one:- CodeChef: Practical coding for everyone
sorry I couldn;t because I only saw find duplicates and hurdled with the TLE for last 1 hour
Instead of making it [N][26], make every node a set of characters and check.
And even with the given size, should it get a TLE?
I made every node an array of 26 characters…It worked quite fine.
1
3 3
1 1 1
1 1 1
1 1 1
aaa
zzz
aaa
Instead of keeping each node as a 26 character array, maybe you could use bitmasks here?