|
|
Общий форумI used my own hash map with modulo 1e5, and buckets with size equal to one it's the case where count of '(' is greater than ')'. For example: (( or (() its wa is something like a Ivan's Car problem [code deleted] Edited by moderator 27.07.2023 17:22 I know that 12th test is so big. Maybe it will help you Edited by author 19.09.2012 02:57 the solution in C++ gave WA12, but the same algorithm in Python gave AC. I think, overflow is comming. There is no checker in this problem. In my solution I 1. Print new line after query even if there is no strings which satisfy it 2. Don't print new line after last query Pls, explain me why i'm wrong Let T is answer. t in [0,T]: x(t)=vx*t, y(t)=vy*t-g*t^2/2 t > T: x(t) = x(T) + (vx+ux)(t-T) = (vx+ux)t - ux*T y(t) = y(T) + (vy - g*T + uy)*(t-T)-g * (t-T)^2/2 = (-g/2)*t^2 + (vy+uy)*t-y*T t1, t2: x(t1)=L, x(t2)=L+l t1 = (L+ux*T)/(vx+ux) t2 = (L+l+ux*T)/(vx+ux) tv: y'(tv)=0, tv = (vy+uy)/g Then i use conditions: 0<T<L/vx, T<2*vy/g h<y(t1)<h+d, h<y(t2)<h+d if tv in (T-eps, T+eps) then y(tv)<h+d My algo: find all candidates from conditions and then check that candidate is good My code: [code deleted] Edited by moderator 27.07.2023 17:23 "Nod can throw a stone with an ABSOLUTE initial speed (ux, uy)." 5 0 0 4 0 4 2 2 4 0 2 answer: 3.640719 u visit end vertex more than one time, idk why we need only 1 time it visit, but by that i got ac a0a* F My WA output N (infinite) I interpret this as (a)concat(0)concat(a*) = {a, aa, aaa, aaaa, ...} This expression describes words of the form xyz, where x comes from the set {a}, y comes from the set {} (i.e. empty set), and z comes from the set {empty_word, a, aa, aaa, ...}. Since y must be an element of an empty set, there is no such word of the form xyz, so the answer is F. If you are solving through comparing Min and Max distance from some border point to center of figure, then check for circle in following way: Max - Min <= 3. why greedy with catching two mins dont work pseydotests: #1: test test, universal base #2: universal, base base, universal #3: universal base test universal Try the test 8 1 7 4 6 3 5 2 8 and 8 8 2 5 3 6 4 7 1 . Both tests have solutions. 1000000000 1000000000 1000000000 0 0 0 answer: It is a kind of magic Please give me some tests, my program passed all the tests on the forum Edited by author 22.07.2020 04:11 3 3:00:00 4:00:00 12:00:00 answer: 4:00:00 4 1:00:00 6:00:00 6:00:00 12:00:00 answer: 6:00:00 3 1:00:00 6:00:00 12:00:00 answer: 1:00:00 you don't know how to write bfs, try watching videos for beginners Try this test: 9 6 2 3 2 5 3 4 1 6 1 Answer: 8 1 6 1 2 2 5 3 4 3 |
|
|