i don't understand the 2nd sample input. i found only 7 squares for B in the following grid, but sample output says there are 8. A B B A B B B B A B B B A B B A the squares i found for B are: 1. - B B - - B B - - - - - - - - - 2. - - - - - B B - - B B - - - - - 3. - - - - - - - - - B B - - B B - 4. ...
your code seems pretty wiered to me. i solved the problem in quite straight forward way. the process i followed is: 1. i made a structure array with an integer for index and a char array for the floating number. 2. i read first line and counted the number of input in that line and store them in the ...
after move of type X is allowed to make moves only Y and Z (X,Y,Z are moves from description -> K,B,T) i think you are right. after making a move X you can make a move either Y or Z and if you make Y next then again you can make a move either X or Z and so on. i used bfs too. i stored the move to r...
well, it seems quite wiered!! :o i've compiled the code you pasted above using two different compilers and tested them using the above input and got the same following output: abcd There is no such word. abcd There is no such word. and i was so confused that i carefully checked your code afterwards,...
i found several mistakes in your code: 1. it seems that you did a mistake declaring the char array. it should be at least 1000001. 2. you don't need to store all the queries which you did using a huge array!! 3. i once gave an advice to declare large arrays global. declaring large arrays local might...
logical error i guess. modify the following code: code to modify: [cpp]if(isPrime(b)) if(a!=b) printf("%lld is emirp.\n",a); else printf("%lld is prime.\n",a); [/cpp] code to replace with: [cpp]if(isPrime(b)) { if(a!=b) printf("%lld is emirp.\n",a); else printf("%l...
no, its not. the idea is, you implement your algorithm with lower limits (which can be supported by your compiler) and increase the limits when you submit. if your algorithm is right you should get AC. its only a trick to use older compilers for this kind of problem. but i guess using a 32-bit compi...