Please tell me that why am I getting WA for all but first test case ? I can understand TLE but why WA?
Please see the code here
Please tell me that why am I getting WA for all but first test case ? I can understand TLE but why WA?
Please see the code here
It looks like I cheated a bit here. I just used the inbuilt StringBuilder functions of append() and insert()…
I got 100 points and i didn’t use segment tree…
Can any one point out mistake in my code(I know my code gives TLE but it say’s WA mainly):
http://www.codechef.com/viewsolution/4391311.
I used rope. (For more information Implicit cartesian tree in GNU C++ STL. - Codeforces)
// #includes ...
#include <ext/rope>
using namespace __gnu_cxx;
using namespace std;
crope S;
char x[MAX_N];
// inserting x into i
void insert(int i){
S.insert(S.mutable_begin() + i, x);
}
void query(int i, int len){
for(int j = 0; j < len; j++){
putchar(S[i + j - 1]);
}
putchar('\n');
}
Using the built-in functions for string, str.insert for inserting and str.substr for printing the substring gave me 100 points!
Here is the AC solution.
Weak Test Cases…?? If not then i am more interested in knowing their built-in implementations!!
Can anyone tell me why brute force solutions are getting accepted?
I think this problem can also be solved with Treap(Balanced BST).
I am getting SIGSEGV for all test cases…I am using linked list can anyone help me?
I am getting SIGABRT for all test cases, here is my solution :
CodeChef: Practical coding for everyone can anyone help me?
I Didn’t Understand The Editorial , Can Someone Please Explain it to me ??
Problem is while printing the substring .
The second parameter is length not index … I did the same mistake …
Mistake is in second type of query …
cin>>i>>l;
for(i--;i<l;i++)
cout<<b[i];
cout<<"\n";
Instead it should be
cin>>i>>l;
for( int f = i ; f < i + l; f++)
cout<<b[f];
cout<<"\n";
Oh No :(…
Ruined the contest!!
Thanks Now.
that’s something new, but in the codeforces blog it uses rope , but you used crope. what’s the difference?
can someone tell me why my solution gives wa my submission id is CodeChef: Practical coding for everyone
I read the manual and found out that crope is just a wrapper for rope or similar.