Search found 19 matches

by sumantbhardvaj
Sun Dec 31, 2006 8:04 pm
Forum: Volume 4 (400-499)
Topic: 439 - Knight Moves
Replies: 33
Views: 11063

439 Wrong Answer

I m getting wrong on this problem ...I have applied BFS . #include<iostream> #include<vector> #include<algorithm> #include<string> #include<queue> using namespace std; struct node { int x,y; int cost; }; class knight { public: int input() { string s1,s2; while(cin) { cin>>s1>>s2; int z=bfs(s1,s2); c...
by sumantbhardvaj
Sat Nov 11, 2006 11:19 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22161

Thanx a lot..i got accepted finally :D :D The problem was somewhere here ... while(cin) { for(int i=1;i<=n;i++) { cin>>x; b[x]=i; } int z=doit(); cout<<z<<endl; } i changed it a bit.. while(cin>>x) // for the first input and then the rest... and it worked.... but i still could not understand that wh...
by sumantbhardvaj
Sat Nov 11, 2006 8:18 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22161

are u talking abt these test cases ( given in the question itself ) 10 3 1 2 4 9 5 10 6 8 7 1 2 3 4 5 6 7 8 9 10 4 7 2 3 10 6 9 1 5 8 3 1 2 4 9 5 10 6 8 7 2 10 1 3 8 4 9 5 7 6 then my program gives following output 6 5 10 9 which matches with the one given . can u be little more precise abt the erro...
by sumantbhardvaj
Fri Nov 10, 2006 4:22 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22161

111 - History Grading

i just do not understand why my code is giving wrong answer. I have applied LCS ( i think its more convinient to apply than LIS here).. But recieving Wrong answer continously ..I have also taken care of the fact that the input gives the ranking of the events not the actual ordering..?? Can anyone ex...

Go to advanced search