hi is the last output for problem C ( fixing Code ) for the last year ( 1383 ) correct ? because i think the answer should be 0 , because none of its string is prefix of the other one !!!!
Salam All !!! First of all I want to congratulate the Sharif University team for their great performance and second I faced with something strange about the official Tehran Site output of the last Contest ( 1384 ): Yesterday I coded the problem “H.Hotel” and when I try to check my program with the Official IO I saw something Strange , my solution gives the right output for all of given input except the 4th one , my program outputs 115 whereas the Official output is 90 . Maybe it is my fault ( missing a part of problem Statement , Coding error , …. ) or my algorithm isn’t right , but as I mentioned before my program gives the correct output for all other inputs And I checked my code over and over and I couldn’t find anything that cause this . I have another problem with this problem and that is about complexity of my algorithm , the complexity of my algorithm is Exponential and it runs too slow for the last input , I haven’t find out a better algorithm but I think for sure there is a better algorithm that can be performed for this problem and gives the output in a reasonable time . I would be happy if someone clarify me about my problem or explain better algorithm, And I solved this problem as follow : ( something like knapsack ) I used STL set and queue to solve this problem , for each room : a) clear the queue b) I consider three states if we fill the room with male , female or a couple( for couple if the capacity of the room is greater or equal to 2 ) for each state I add the current state with all of the set elements and push to the queue c) for all the elements of the queue I search the set to find the element that has the same ( M , F , C ) if I didn’t find the element that has this condition insert the element of queue in to set , otherwise I compare the prices and I set the prices in to the less price at last I check the element that has greater or equal male and female from the total male and female that is given in the input and if the result is greater than the price swap them and at last I output the result .:-) Thanks in Advance . . . . my E-mail Address is [email protected] , Arsalan Mousavian
به وبلاگ رسمی مسابقهی بینالمللی برنامهسازی دانشجویی (ICPC) در تهران خوش آمدید. بیست و پنجمین مسابقهی منطقهای تهران روزهای ۲۹ و ۳۰ آذرماه ۱۴۰۳ به میزبانی دانشگاه صنعتی شریف برگزار میشود.