| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Hints | Abid29 | 1887. Карта постоянного пассажира | 16 сен 2022 23:03 | 1 |
Hints Abid29 16 сен 2022 23:03 You only have four things to pick from, so you can calculate each step explicitly. This equation follows the notation in the article: T is the time to collect all of the items, and ti be the time to collect the i-th item after i−1 items have been collected. E(T)=E(t1)+E(t2)+E(t3)+E(t4)=p1−1+p2−1+p3−1+p4−1. The probability p1 of picking a new one if you have picked none yet is 1. The probability p2 of picking a new one if you have picked one depends on which one you picked first. Let's call the items A through D and the probabilities of picking each item if they're all in the box pa through pd. Then p2 would be pa(pb+pc+pd)+pb(pc+pd+pa)+pc(pd+pa+pb)+pd(pa+pb+pc). The above expression is the probability of picking a new one given that A had been picked already, plus the probability of picking a new one given that B had been picked already, and so on. The expression for p3 will have six terms in the sum; one of these will be papb(pc+pd). The expression for p4 will have four terms in the sum (actually, it's the same term four times!) |
| WA12 | Borozdin Kirill | 1027. Снова D++ | 16 сен 2022 16:18 | 2 |
WA12 Borozdin Kirill 2 ноя 2010 18:13 What can I do?.. My program passes all testes here, but still WA12... Any test cases? |
| enjoyed it | Abid29 | 1238. Folding | 16 сен 2022 12:54 | 1 |
it takes a lot of my times. |
| what is the mistake here and why the limit of 10 cans? | hellknife | 1409. Два бандита | 15 сен 2022 23:48 | 1 |
#include<iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << b-1 << ' ' << a - 1; } |
| Some tests | Конобейцев Иван Олегович | 1129. Покраска дверей | 15 сен 2022 09:36 | 1 |
Some tests Конобейцев Иван Олегович 15 сен 2022 09:36 4 2 2 3 2 1 3 3 1 2 4 1 3 6 5 2 3 4 5 6 5 1 3 4 5 6 5 1 2 4 5 6 5 1 2 3 5 6 5 1 2 3 4 6 5 1 2 3 4 5 8 7 2 3 4 5 6 7 8 7 1 3 4 5 6 7 8 7 1 2 4 5 6 7 8 7 1 2 3 5 6 7 8 7 1 2 3 4 6 7 8 7 1 2 3 4 5 7 8 7 1 2 3 4 5 6 8 7 1 2 3 4 5 6 7 6 2 2 3 2 1 3 2 1 2 2 5 6 2 4 6 2 4 5 |
| wrong constant of earth | yyll | 1030. Титаник | 15 сен 2022 08:39 | 1 |
diameter of 6875 miles (/ 2 = 3437.5)??? the mean radius of earth is 6371.0 km (3958.8 miles) |
| Runtime error WA 14( Python) | Akashi | 1493. В одном шаге от счастья | 13 сен 2022 23:20 | 1 |
a = input() minussum=0 plussum=0 b =[0:3] c =[3:6] c=int(c) minus = c-1 plus = c+1 minus=str(minus) plus=str(plus) for i in minus: i=int(i) minussum+=i for i in plus: i=int(i) plussum+=i n=0 for i in b: i=int(i) n+=i if n == minussum or n == plussum: print("Yes") else: print("No")
Help please) Why re? Edited by author 13.09.2022 23:21 |
| To admins: python files with UTF-8 BOM | Nikolay Shelukhin | | 13 сен 2022 02:21 | 1 |
Python files encoded in UTF-8 with BOM always get "Runtime Error 1". It would be nice if it was fixed. |
| LOL I USED SUPER bRuTeFORCE AND GET TLE | 👑TIMOFEY👑 | 1673. Допуск к экзамену | 12 сен 2022 17:27 | 1 |
I just do maxsimum 30 iteration on my super all doing bruteforce and this give me right ans and i got ac |
| Is it possible to solve it with Discrete Logarithm? | Igor Parfenov | 1132. Квадратный корень | 12 сен 2022 02:15 | 1 |
I could solve it using trivial bruteforce. But I get TL, using more clever and probably expected solution. I used this: https://e-maxx.ru/algo/discrete_root (Read only first section, we don't need anything else). The slowest part here is Discrete Logarithm, which I calculate in \sqrt{n} * log_from_map. |
| Asking for help at WA-17 | alexwangxiang | 1951. Комплексный корень | 9 сен 2022 21:34 | 2 |
My program stuck at WA-17 for several times and I don't know the reason why. Can anyone give me some challenging test cases? Update: accepted now. Key point is to run unit test for the integral division function that I wrote. Both self-written complex division and std::complex<long double> division can be used to get approximate value of the quotient. |
| Anybody give me some tests please! | Landsknecht | 1602. Лифт | 8 сен 2022 15:45 | 4 |
The more - the better! 'cause I have no idea what I'm doing wrong :\ 50 49 8.4 5.5 //1 50 49 8.4 5 //25 50 49 8.4 4 //28 50 49 8.4 2.0 //37 50 49 8.4 0.2 //48 The answer of second test case is 1, not 25. My ac programm gives 1 for second and 25 for third test |
| Runtime error c++ can't find solution | Ionut Marian | 1787. Поворот на МЕГУ | 8 сен 2022 12:29 | 1 |
#include <iostream> using namespace std; int main() { int leavingCars, minutes; int carPerMinute[100]; int totalCars = 0;
cin >> leavingCars >> minutes; int carsLeavingPerMinute = leavingCars * minutes;
for(int index = 1; index <= minutes; ++index) { cin >> carPerMinute[index]; totalCars += carPerMinute[index]; }
cout << totalCars - carsLeavingPerMinute;
return 0; } |
| i'm shoked i'm just play with precision and got many wa and by that ac | 👑TIMOFEY👑 | 1864. Посиделки у Дена | 7 сен 2022 15:37 | 1 |
|
| JS Support | Поддержка JS | Inugami | | 7 сен 2022 00:42 | 1 |
Are you going to add javascript (especially nodejs) support for this online judge | Планируется ли добавить на сайт поддержку javascript или nodejs? |
| easy bfs | 👑TIMOFEY👑 | 1490. Огненный круг | 6 сен 2022 20:53 | 1 |
|
| с#,4 и 21 тестs | Sergey | 1601. АнтиКАПС | 5 сен 2022 22:27 | 3 |
not 21 passes test: using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main() { var f = Console.In.ReadToEnd(); f = f.ToLower(); var b = f.ToCharArray(); string c = ""; c += b[0].ToString().ToUpper(); for (var i = 1; i < b.Length - 3; i++) { if ((i + 1 != b.Length && (b[i] == '!' || b[i] == '?' || b[i] == '.'||b[i] == '-') && (b[i+3] != '-'&&b[i + 1] != '!' && b[i + 1] != '?' && b[i + 1] != '.')))
{ c += b[i]; i++; while (b[i] == ' ' || b[i] == '\t' || b[i] == '\r' || b[i] == '\n') { c += b[i]; if (i + 1 != b.Length) i++; else break; } c += b[i].ToString().ToUpper(); } else c += b[i]; } Console.WriteLine(c); } } } not 4 passes test: using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main() { var f = Console.In.ReadToEnd(); f = f.ToLower(); var b = f.ToCharArray(); string c = ""; for (var i = 1; i < b.Length - 1; i++) { if (b[i - 1] == '-') i--; if ((i + 1 != b.Length && i + 2 != b.Length && i + 3 != b.Length && (b[i] == '!' || b[i] == '?' || b[i] == '.' || b[i] == '-') && (b[i + 3] != '-' && b[i + 1] != '!' && b[i + 1] != '?' && b[i + 1] != '.'))) {
c += b[i]; i++; while (b[i] == ' ' || b[i] == '\t' || b[i] == '\r' || b[i] == '\n') { c += b[i]; if (i + 1 != b.Length) i++; else break; } c += b[i].ToString().ToUpper(); } else { if (i == 1) c += b[i - 1].ToString().ToUpper(); c += b[i]; } } Console.WriteLine(c); } } } Edited by author 03.01.2015 21:08 - IS IT CORRECT? - YES, IT IS. - Is it correct? - Yes, it is. Мне этот пример помог 21 тест пройти If you have this problem - remember that a sentence is ended only with "!?." Endline is not an end of a sentence |
| guid for tle 7,9 and fast solution | 👑TIMOFEY👑 | 1211. Круговая порука | 5 сен 2022 14:27 | 1 |
Here are jokes with statuses, such as we go in order along the vertices and if we get to a vertex that we haven't been to, then we start going in a cycle from this vertex, setting the status of this cycle, if we get to the same status, then this is a cycle, if we get to a vertex with a lower status, then everything is fine and we stop the cycle, and if the vertex has no status, then we just opened a new vertex and it turns out that the algorithm is linear |
| My story , wa11 and test cases | 👑TIMOFEY👑 | 1628. Белые полосы | 5 сен 2022 08:58 | 1 |
I've been trying to solve this problem for so long, I've had a lot of errors, more than 150 lines of clean code, I've tried to do a little dirty debug, but I think it's not fair. I got wa11, I didn't know what it was, it just turns out I forgot to sort the array correctly, it was in the second part when I'm looking for vertical stripes that I forgot to sort and got wa 11, while I was looking for it, I did a lot of tests and can show them to you. I can give advice on what to count, count all vertical rectangles 1*l where l>=2 and horizontal rectangles l*1 where l>=2, add them up and add all single cells. tests: 4 4 10 1 2 1 3 2 1 2 4 3 2 3 3 4 1 4 2 4 3 4 4 5
4 4 5 1 2 2 1 2 4 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4 1 3 2 12 7 5 1 2 3 13 7 5 2 3 3 4 3 15 7 5 10 1 2 2 2 5 2 6 2 7 2 1 4 2 4 5 4 6 4 7 4 7 7 4 14 1 1 3 1 5 1 7 1 2 2 4 2 6 2 1 3 3 3 5 3 7 3 2 4 4 4 6 4 14 5 1 4 1 1 3 1 4 1 5 1 2 WRONG!!! on this test i have eror, right ans is 1 good luck, don't give up it's not such a difficult problem! |
| Что за тесты???? | Dekado | 1628. Белые полосы | 3 сен 2022 23:16 | 8 |
Каким образом во втором тесте(примере) получаем 2 полосы??? если даже когда вручную нарисовав таблицу 1х5, получаем максимум 1 полоску????каким образом вторая получается??? п.с.или белая полоса может состоять из одного дня???? How in the second test(example) does get 2 bars??? if even when by hand drawing a table 1x5, get a 1 strip maksimum???? how does the second turn out??? p.s. or can a white bar consist of one day???? Kakim obrazom vo vtorom teste(primere) poluchaem 2 polosy??? esli dazhe kogda vruchnuju narisovav tablicu 1h5, poluchaem maksimum 1 polosku????kakim obrazom vtoraja poluchaetsja??? p.s.ili belaja polosa mozhet sostojat' iz odnogo dnja???? Без комментариев No comments Bez kommentariev Исправьте тесты! Неправильные примеры. It is all right. Even 1 square is the bar (if it not contains in other bars). So it must be added. ti cho otvet 0, poloska dlinoi odin ne mojet bit, a test is inkarekt |