|
|
Общий форум0) AC solve is DP on tree. 1) In DP inf = 1e9. 2) All test in the forum: 5 5 3 1 1 4 1 10 2 3 20 3 5 20 ans = 21 7 4 1 2 10 1 3 20 2 4 30 2 5 0 3 6 0 3 7 40 ans = 100 4 1 1 2 1 1 3 2 2 4 3 ans = 2 5 1 1 2 1 1 5 0 2 3 0 2 4 0 ans = 1 7 3 1 2 1 1 3 39 2 4 40 2 5 40 3 6 39 3 7 39 ans = 117 5 2 1 3 1 1 4 10 2 3 20 3 5 20 ans = 21 Edited by author 12.05.2008 19:54 thanks a lot for your test cases! Thank you for test data. I suppose there is typo in case #1. Correct answer must be 51. Why in the first example ans=21? I think it must be 51. Why in the first example ans=21? I think it must be 51. First test is incorrect. Q must be <=N-1. I could AC all your tests, but I still got WA. THX My falt was that my inf was too litlle ^^ thx a lot! 吃粪汁啦 第一组和第三组数据吃粪一样的。。。第一组很明显不可能啦 第三组这叫一个苹果“二叉”树 Edited by author 03.12.2011 06:51 Edited by author 03.12.2011 06:51 3-rd test case is incorrect, because "any biparous branch splits up to exactly two new branches" Remember that the tree should always be a tree (you can't split it into several components)... are you sure i think 5 5 mean we must have all vertex ans ans is 51 5 5 3 1 1 4 1 10 2 3 20 3 5 20 ans = 51 no matter who plays first and which sign is between numbers 5 5 4 3 2 1 (2) 1 1 (1) 10 3 3 4 2 5 6 1 9 9 3 (4) wrong answer on 1st test obmanul suka you should output edges in input order a,b = map(int,input().split()) if (a % 2 == 0 and b % 2 != 0): print("yes") else: print("no") because data type should be string, not integer sorry, my bad. data type is correct, but you should input like that: a=int(input()) b=int(input()) Check that you use only shortest routes. I don't have any tests, but when I started checking this, then I got ACC. Таким образом, если для данного перекрёстка нет подразделений СКБ Контур находящихся ближе, чем в 6 кварталах, то мы обозначим его числом 0. Carefully read this part of text. Try n = 100000 and remember that 1e6 * 1e6 > 2e9. The most important thing is that you shouldn't keep finding sets when you've already found 10,000. Then you can optimize a little simple search and you get ACC. Good luck! To enter variables correctly is more difficult then solve this problem. I think, it isn't very good idea to issue input like this. please help me. i have some problems in test 5. please help me! my DFS is TLE does DFS don't TLE? can someone give me some help? ppsxy you should write DP of course. what's more my program doesn't TLE.Instead it WAs on #12 ترو خدا؟؟؟ ناموسا ایرانی هستی؟ ای کلک -> think of doing this problem first -> count of n digits numbers whose sum is equal to x. ->First try to think for smaller numbers less than 1000 i.e from 1 to 999. -> Create the tree for the same i.e numbers less than 999. -> after finding f(n,sum)(n is the number of digits and sum is the required sum). -> you can find f(9,sum)for all numbers less than 1000000000. -> now finally you need to handle for one number 1000000000. Cheers Edited by author 31.07.2020 12:43 I calculated two points of intersection from line that go through two points((x_mid, y_mid) and (x_circle,y_circle)) and then picked nearest two given two points.But this gives me WA3. What should i do? You need to check the possibility of a shot. The enemy may be out of your sight. kostan3 Rating 29 июл 2020 23:41 Is it possible to return my profile to the rating and under what conditions? Edited by author 04.08.2020 00:40 A programmer has a set of banknotes valued 1, 3, 9 ..., 3^k,... one each. He has to pay N in a restaurant (provided) He must pay that much M so: M can be paid with banknotes the programmer has, i.e. he cannot pay 5, because he does not have 2 bank notes with value of 1; and M-N must be represented the same way, i.e. if N is 4, M cannot be 9, because 5 cannot be represented as a sum of 3^K, one or less for each K. So if asked 4, a programmer must pay 13, 13=9+3+1, 13-4=9. I hope you will understand this clumsy explanation. Thanks for the explanation. here 4 can be represented as 1+3^1 . why i have to pay 13 ? I failed to understand the problem ? 1.declare an array.size 1000000 2.genarate all number according the problem description. 3.input the value n. 4.declare a container and take the value of the array .vector<int>v(a,a+n); 5.sort the container. 5.at last print v[n]; Edited by author 26.07.2020 04:57 Edited by author 26.07.2020 04:58 If you have TLE on 17-th test , try to use clang compiler. For me it worked)) try this: 3 2 1 3 2 3 1 2 answear: 1 You realy snooze a lot my code have wrong in test5 and the ansear this test is correct:( Please do not waste the rest of your time Edited by author 25.07.2020 15:37 Edited by author 25.07.2020 15:37 |
|
|