i think my code gives right output for all input except this input: input: 1 abcdefghijklmnopqrst 88888888888888888 AC output: aorshnpkdlmiqtgfejbc MY output: aorshnpkdlmiqtgfebcj can anyone help me to fix the bug of my code??? #include<iostream> #include<vector> #include<cstring> #include<cmath> #i...
the procedures i use: 1.taking the depth and number of coin in a structure. 2.then i sort(high to low) the structure according to the number of coin. 3.then take the treasure if it fullfil the condition.that's it. is my procedure wrong? i check all the input from this thread and every AC output matc...
i use priority queue and BFS. but i can not understand why getting TLE everytime????please anyone check my code .......... My code below: #include<iostream> #include<cstring> #define M 1000000 #define INF 999999 using namespace std; int dx[4]={-1,+1,0,0}; int dy[4]={0,0,-1,+1}; int A[999][999]; int ...
i use priority queue and BFS. but i can not understand why getting TLE everytime????please anyone check my code .......... My code below: #include<iostream> #include<cstring> #define M 1000000 #define INF 999999 using namespace std; int dx[4]={-1,+1,0,0}; int dy[4]={0,0,-1,+1}; int A[999][999]; int ...
i use priority queue and BFS. but i can not understand why getting TLE everytime????please anyone check my code .......... My code below: #include<iostream> #include<cstring> #define M 1000000 #define INF 999999 using namespace std; int dx[4]={-1,+1,0,0}; int dy[4]={0,0,-1,+1}; int A[999][999]; int ...
WHY WA.............. my procedure is: 1.first i take dimentions and sort them. 2.then make a directed graph according to (u,v) is the index of boxes and if v fits in u then there is a direction u to v. 3.then find topological sort of the directed graph and take the order in a stack. 4.form the stack...
i solve this problem using LIS then i am trying to solve by DFS(topological sort). But the problem is: 1. how can i find the maximum sequence from the topological order. 2.and the path of the maximum sequence from the topological order. can anyone solve this prob using dfs.......and want some help.
please help me......what is the problem in my code???? Every time getting Wrong Ans!!!!!!! #include<iostream> #include<cstring> #include<map> using namespace std; map <char,int>M; void Swap (char* a, char* b) { char t = *a; *a = *b; *b = t; } void lexicographical_Permutations(char str[],int n) { for...
Why getting WA?????????????i think it's an easy problem bt i can not find the bug...........pls help....... #include<iostream> #include<cstdio> using namespace std; int EUCILD(int a,int b) { if(b==0) return a; else EUCILD(b,a%b); } int main() { int A[101]; int t,a; cin>>t; while(t--) { int i=0,c; in...
Help me.....i can't understand what the problem says and the input and output........pls can anyone give me the explanation what the problem says and why the input and output looks like????????
pls help me!!!!!!!! where is the problem to my code???? it's very annoying to me!!! why my code getting Runtime Error and what is the proper meaning of Runtime Error??? #include<iostream> #include<string> using namespace std; int Min(string x,string y) { if(x.length()>y.length()) return (y.length())...