| Show all threads Hide all threads Show all messages Hide all messages |
| WA 9 hint | D4nick | 2148. Insane Shot | 18 Sep 2020 17:44 | 1 |
Test 9 is about the possibility of the shoot. For example I just changed < on <=: if (4 * (pow(x1 - xc, 2) + pow(y1 - yc, 2) - pow(r, 2)) <= pow(x2 - x1, 2) + pow(y2 - y1, 2)) { |
| explanation for solution | lostbrain | 1139. City Blocks | 16 Sep 2020 22:50 | 1 |
|
| test 2 | Arseniy | 2034. Caravans | 16 Sep 2020 21:58 | 3 |
test 2 Arseniy 30 Mar 2016 00:22 I figured out that n == 8 in test 2. It may be useful for somebody. I got my problem I erased from multiset in a wrong way what is the whole test case ? . i am getting wrong answer on test case 2 ! |
| What is the answer for 111111113 | Samvel | 1120. Sum of Sequential Numbers | 15 Sep 2020 17:25 | 6 |
My AC solution returns 55555556 2 Hi, Mine is same as Howard Liu i.e. 55555556 2 Varun > My answer is 61313 68558 This is an answer for 6553562057. I also get 55555556 2 for 111111113. |
| WA14 | Rodion | 2035. Another Dress Rehearsal | 14 Sep 2020 23:37 | 1 |
WA14 Rodion 14 Sep 2020 23:37 pls help, what is in test №14 |
| Why test # 6 is wrong? | AlexRad | 1607. Taxi | 14 Sep 2020 18:26 | 4 |
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var tokens = Console.ReadLine().Trim(). Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); var a = int.Parse(tokens[0]); var b = int.Parse(tokens[1]); var c = int.Parse(tokens[2]); var d = int.Parse(tokens[3]); var min = a + (c - a) / (b + d) * b; var max = c - (c - a) / (b + d) * d; min = Math.Min(min + b, Math.Max(min, max)); max = Math.Max(max - d, min); Console.WriteLine(max); Corrected, see !!! sign Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var tokens = Console.ReadLine().Trim(). Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); var a = int.Parse(tokens[0]); var b = int.Parse(tokens[1]); var c = Math.Max(int.Parse(tokens[2]), a); // !!!! var d = int.Parse(tokens[3]); var min = a + (c - a) / (b + d) * b; var max = c - (c - a) / (b + d) * d; min = Math.Min(min + b, max); max = Math.Max(max - d, min); Console.WriteLine(max); } This is strange: "The driver would not ask a sum that is less than that offered by Petr." #include<bits/stdc++.h> using namespace std; int gcd(int a,int b){ if(b==0)return a; return gcd(b,a%b); } int main() { int a,b,c,d; cin>>a>>b>>c>>d; int carry=(c-a)%(b+d); int res=(c-a)/(b+d); if(carry==0){ cout<<a+res*b<<'\n'; } else if(carry>=b){ cout<<a+(res+1)*b<<'\n'; } else if(carry<b){ cout<<c-res*d<<'\n'; } } why wrong ans in test #6? |
| WA22 | Levon Oganesyan | 2146. Quiz Show | 13 Sep 2020 04:34 | 1 |
WA22 Levon Oganesyan 13 Sep 2020 04:34 |
| hint python | Rodion | 2056. Scholarship | 12 Sep 2020 22:32 | 1 |
if u wanna break your programm type sys.exit() (don't forget to type import sys in the beginning of the programm) _____________________ если вы хотите полностью прервать вашу программу, то импортируйте библиотеку sys и пропишите sys.exit() |
| TLE8 Python | Manfre | 1196. History Exam | 12 Sep 2020 05:03 | 4 |
Could anyone give a piece of advice if i have a time limit exceeded with binary search? Try sys.stdin.readline() instead of input() It was helpful for me 0. use sys.stdin.readline() (but not readlines! to avoid MLE) 1. do not convert strings to integers 2. use standard set, check x in set using these ideas i got ok in 0.656, but i'm still wonder how to achive 0.093 (as the best one) UPD: 0.328 can be achived via os.read by parts ~500kb + len(list(filter(...))) Edited by author 12.09.2020 06:07 |
| HELP PLEASE WA TEST#8 | Лерник Казарян [RAU] | 1118. Nontrivial Numbers | 11 Sep 2020 21:29 | 2 |
the right border is a Prime number |
| Wrong Answer at Test Case #12 | Zhang Fei | 2142. Magic | 11 Sep 2020 20:41 | 1 |
It's never endless fixing |
| Wrong Answer at Test Case #10 | Zhang Fei | 2142. Magic | 11 Sep 2020 19:32 | 1 |
Ok I understand now...It means in blue-red land you can either grab mana from blue or red. Edited by author 11.09.2020 20:18 Edited by author 12.09.2020 17:07 Edited by author 12.09.2020 17:08 |
| New tests | lilipottter | 1810. Antiequations | 11 Sep 2020 17:34 | 1 |
Hm. Seems there are no tests with small number of linear independent rows. I have two solutions with different answers to such tests, but both got OK. Admins, please, add some. 30 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 30 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 x20 30 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 x10 |
| Tips to solve | guilty spark | 1205. By the Underground or by Foot? | 9 Sep 2020 20:40 | 1 |
1. Stations may not all be connected. You may have to walk on foot between stations. 2. A and B may be one of the stations or may even be the same point. Maybe the best route is from A to B is on foot without using any stations. Consider all cases. 3. Coordinates are floating points, not integer. 4. Simple dijsktra will work. 5. Use a map to store the node number of the points. If A or B are not one of the stations then give them n and n+1 or n+1 and n+2 (depending on indexing). |
| Math | lilipottter | 1276. Train | 9 Sep 2020 03:01 | 1 |
Math lilipottter 9 Sep 2020 03:01 It is said "Tags: dynamic programming" But also there is math approach. In this case solution is simple math formula kind of \sum\sum C(x,y)*C(t,m). Complexity is O(n^2). Good luck. |
| If you have WA 2 | Alexey Dergunov [Samara SAU] | 1922. Superhero Team | 8 Sep 2020 15:49 | 4 |
Test 1: 3 1 2 3 Answer 1: 1 3 1 2 3 Test 2: 3 1 3 3 Answer 2: 2 1 1 3 1 2 3 P.S. Statement is not understandable :( Edited by author 28.12.2012 14:24 ups .all ok thx Edited by author 11.06.2013 19:02 test that gives WA2 5 7 3 3 4 4 answ: 1 4 5 4 3 2 If you don't think about that - it's not clear, but ,theoretically, that told all that they should have told |
| Solvable with DP (TLE) | guilty spark | 1222. Chernobyl’ Eagles | 7 Sep 2020 17:15 | 1 |
This question can be solved using the same logic in 1167(Bicolored horses), but it will give tle. |
| For wa#25 | guilty spark | 1671. Anansi's Cobweb | 7 Sep 2020 15:22 | 1 |
There can be multiple edges. For instance: 1 2 2 1 Using a set will give WA. Try multi-set or some other data structure in c++. Edited by author 07.09.2020 15:22 Edited by author 07.09.2020 15:22 |
| WA8 Please, explain, what is the reason? | Solverdce | 1320. Graph Decomposition | 7 Sep 2020 14:59 | 2 |
WA8 Please, explain, what is the reason? Is this just a problem of input/output or this is just such test case? I found the problem, wrong algorithm. |
| my research | coder | 2125. Continue the Sequence | 6 Sep 2020 19:40 | 1 |
Let c[i][0] = a[i], i = 1..n c[i][1] = c[i+1][0] - c[i][0], i = 1..n-1 c[i][2] = c[i+1][1] - c[i][1], i = 1..n-2 .... c[i][d] = c[i+1][d-1] - c[i][d-1], i = 1..n-d. if hardness of a[i] is d. so all c[i][d] = const. 1. Find minimum d, that all c[i][d] - is const. (example: binary search). 2. build b[n+i] from c[i][d]. There can calculate c[i][j] through a[i] sequences: c[i][1] = a[i+1] - a[i] c[i][2] = c[i+1][1] - c[i][1] = (a[i+2] - a[i+1]) - (a[i+1] - a[i]) = a[i+2] - a[i+1] - a[i+1] + a[i] = a[i+2] - 2*a[i+1] + a[i]. c[i][3] = c[i+1][2] - c[i][2] = (a[i+3] - 2*a[i+2] + a[i+1]) - (a[i+2] - 2*a[i+1] + a[i]) = a[i+3] - 3* a[i+2] + 3*a[i+1] - a[i]. .. c[i][d] = SUM( c[i + d - j ] * Binom(d, j) * (-1)^j, j = 0..d) where Binom(d, j) - Binominal coefficients , or coefficients of (x+y)^d . if d - is known,
c[1][d] = c[2][d] = ... = c[n-d][d] = W - constanta. b[n+1] = x c[n-d+1] = b[n+1] + SUM(a[n + 1- j] * binom(d,j)*(-1)^j, j = 1..d) = W b[n+1] = W - SUM(a[n+1-j] * binom(d,j)*(-1)^j, j = 1..d) and so on. Only one problem, how fastest calculate SUM(a[i + d - j] * binom(d,j)(-1)^j, j = 1..d) ?
|