| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| I got AC! But i have question | Felix_Mate | 1437. ACM для ГСМ | 28 мар 2023 13:43 | 3 |
Я решил задачу с помощью графа, где вершинки - состояния ёмкостей,и рассмотрел из очередного состояния все переходы, запоминая те состояния ,где уже был. Но я никак не могу оценить кол-во возможных состояний. Может кто-нибудь подскажет как оценить? Самая грубая оценка - у нас есть числа a,b,c>=0 и a+b+c=N(для случая,когда не подливаем и не выливаем-в этом случае сумма константа). Тогда количество таких чисел O(N^3),но это ужасная оценка. Согласен, было бы интересно узнать максимальное количество возможных состояний и при каких значениях a,b,c оно достигается Edited by author 16.11.2019 13:00 Можно оценивать так: пусть ёмкости не превосходят значения C. Рассмотрим возможные переходы между состояниями. 1) Когда подливаем из заправки в канистру. Тогда канистра, в которую подливаем, становится полной. 2) Когда переливаем между канистрами. Тогда либо канистра, в которую переливаем, становится полной, либо канистра, из которой переливаем, становится пустой (либо и то, и то). Получается, что в каждом состоянии хотя бы одна канистра либо пустая, либо полная. Тогда количество состояний можно оценить как 6*(С+1)^2, то бишь O(C^2). |
| Please tell me what is the test 6? | quocanh34 | 1604. В Стране Дураков | 27 мар 2023 22:09 | 1 |
|
| If you have WA #9 | Smilodon_am [Obninsk INPE] | 1982. План электрификации | 27 мар 2023 17:15 | 7 |
First I used Kruskal algo but got WA9 verdict. My program didn't give right answer for next test: 4 1 4 0 1 1 100000 1 0 1 100000 1 1 0 100000 100000 100000 100000 0 right answer: 100002 Implementation of Prim algo gave the correct answer at last. HM, i have right output on this test, but WA 9 This test helped me.... 5 2 1 3 0 1 2 3 4 1 0 2 3 4 2 2 0 3 4 3 3 3 0 4 4 4 4 4 0 =8 (I was getting 9). Basically my algorithm (roughly Prim's) tried to short-cut checking vertex weights. For any node, make sure you check verices to ALL nodes.... HM, i have right output on this test, but WA 9 Some tests: 4 2 1 4 0 4 8 9 4 0 2 7 8 2 0 1 9 7 1 0 Answer 3 4 2 1 3 0 6 7 8 6 0 2 3 7 2 0 4 8 3 4 0 Answer 5 Edited by author 27.10.2015 20:10 5 3 1 3 2 0 1 2 3 4 1 0 2 3 4 2 2 0 3 4 3 3 3 0 4 4 4 4 4 0 answer is 7 Edited by author 19.02.2019 12:09 One more test that helped me to find my error for WA #9. 5 2 1 5 0 1 100 150 200 1 0 10 50 200 100 10 0 11 100 150 50 11 0 2 200 200 100 2 0 Answer: 13 c[i][j] = c[j][i] This is wrong test |
| if you have WA#10 try this: | hoan | 1542. Автодополнение | 26 мар 2023 18:27 | 2 |
input: 2 b 1 a 1 2 a b output: a [empty] b hope can help you! GOOD LUCK! also, it has more than 10 matches |
| New tests added | Merkurev Oleg [Dandelion] | 1613. Для любителей статистики | 24 мар 2023 22:02 | 1 |
New tests were added. All accepted solution were rejudged, ~4% of them lost their accepted status |
| 2 lines programm, lol. It's not difficult at all | D4nick | 1582. Букмекеры | 24 мар 2023 00:33 | 2 |
It can be at least 3 lines of code if you write one statement per line (in plain C) double k1, k2, k3; scanf("%lf %lf %lf", &k1, &k2, &k3); printf("%.0lf", /* The Expression */); Edited by author 24.03.2023 00:40 |
| ошибка в тесте 8 | Denis | 1005. Куча камней | 23 мар 2023 19:59 | 3 |
не могу найти ошибку,возможно ли узнать какие числа вбивает 8-й тест? Только это называется не "ошибка в 8-м тесте" (сам тест корректен), а "ошибка *в решении* НА 8-м тесте". Тест - просто случайный тест, направленный на убивание жадных решений. Эту задачу неверно решать жадным алгоритмом. тест не случайный, так как при разных алгоритмах ошибки всегда под одними и теми же номерами |
| WA #2 | Pat | 1226. йынтарбО кодяроп | 21 мар 2023 18:28 | 1 |
WA #2 Pat 21 мар 2023 18:28 Check if your input correctly outputs the last word, if the last character is latin. The first test ends with a . Edited by author 21.03.2023 18:29 |
| is true? | Didi (OSU11) | 1997. Это не те дроиды, которых вы ищете | 21 мар 2023 08:56 | 2 |
input: 6 3 8 1 0 2 0 3 0 4 0 5 1 7 1 10 1 12 1 output: No reason 1 10 2 5 3 12 4 7 |
| WA #3 | Iury Izotov FT-16 | 1080. Раскраска карты | 21 мар 2023 05:06 | 3 |
WA #3 Iury Izotov FT-16 26 июн 2016 17:12 I dont know, but if you are using BFS in your solution, you should remember, that graph can contain more than 1 connected component. Try this test: 6 2 3 0 0 0 5 6 0 0 0 one of answers: 011100 тест неверный, по условию можно в любую страну перейти, а у вас например из 1 в 4 не перейти |
| how you knew, what the test including? | Andre Marin | 1005. Куча камней | 20 мар 2023 21:26 | 1 |
|
| C# Solution | Serge | 1083. Факториалы!!! | 19 мар 2023 18:48 | 2 |
//Don't ask me. I don't know. Just work. If anybody can tell me why for (int i = k + 7; i >= 0; i--) and why we needn't n%k - Please, tell! I don't understand. using System; namespace ConsoleApp32 { class Program { static void Main(string[] args) { string[] vvod = Console.In.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); int n = int.Parse(vvod[0]); string k1 = vvod[1]; int k = k1.Length; int q = 1; for (int i = k + 7; i >= 0; i--) { int t; t = n - i * k; if (t > 0) q *= t; } Console.WriteLine(q); } } } Edited by author 13.01.2018 23:49 because we have more than 1x! (minimum 2) and less or exactly 9 (because we have 9 numbers 2...10 and it nevermind if we have more !...! than 9). so we have k = 9-2 =7 (maximum) if we use % and the number of '!' is > 10 we have wrong answer, because we have zero: x%y=0 Edited by author 19.03.2023 19:49 |
| For WA4 | Pat | 2033. Девайсы | 17 мар 2023 18:46 | 1 |
Make sure your code can choose devices other than the 1st one from the list... |
| Python-runtime_error | Klim Shramko | 2023. Дональд-почтальон | 14 мар 2023 04:27 | 1 |
Why does this code throw a runtime error? Everything is right!! from sys import stdin pocht_1 = ["A", "P", "O", "R"] pocht_2 = ["B", "M", "S"] pocht_3 = ["D", "G", "J", "K", "T", "W"] count = 0 mesto = 1 for i in sys.stdin.split("\n")[1:]: if i[0] in pocht_1: if mesto == 3: count += 2 elif mesto == 2: count += 1 mesto = 1 elif i[0] in pocht_2: if mesto == 1: count += 1 elif mesto == 3: count += 1 mesto = 2 else: if mesto == 1: count += 2 elif mesto == 2: count += 1 mesto = 3 print(count) |
| WA16 | andreyDagger`~ | 1285. Нитка в гиперкосмосе | 13 мар 2023 21:32 | 1 |
WA16 andreyDagger`~ 13 мар 2023 21:32 1 2 0 0 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2.24 |
| Easy ~ | [RISE] Levon Oganesyan [RAU] | 1685. Орфография | 13 мар 2023 21:23 | 6 |
Easy ~ [RISE] Levon Oganesyan [RAU] 3 авг 2014 05:07 My solution is 20 lines. Easy problem. 14 lines solution with using recursive function. Re: Easy ~ [RISE] Levon Oganesyan [RAU] 31 авг 2014 21:03 I have recursive function too. Whatever, Good Job! 7 lines with recursive func in python 3. Or 14 with normal look a code. |
| Weak tests | [ЛЕСТЕХ] UstinovG`~ | 1992. CVS | 13 мар 2023 13:39 | 3 |
All operations except clone work O(1) in my program, but clone works in O(n). Despite that fact, my solution works in 0.218s New tests were added. Thank you. Edited by author 27.09.2020 14:29 Tests not check memory leaks, but check amount of used memory... Its weard. If you dont copy robot's stacks and just relink pointers, tests not check that you have lost memory Case Learn 1 1 Learn 1 2 .... Learn 1 n Clone 1 Rollback 1 Rollback 2 .... Rollback 1 Rollback 2 Learn 1 1 ... Learn 1 n In my solution in the end youll have n losted elements and n new elements in 1 robot that is assimptotically equal to copy all stacks |
| If you get WA6 | Denis Koshman | 1463. Радость населению! | 11 мар 2023 15:22 | 2 |
Read problem statement more closely. The graph can be disconnected. Read problem statement more closely. The graph can be disconnected. Really helped me a lot. |
| runtime error python | Vitaly Nedzvetsky | 1493. В одном шаге от счастья | 10 мар 2023 00:23 | 1 |
import sys num = str(sys.stdin.readline().split()[0]) a = int(num[:3]) b = int(num[3:]) - 1 c = int(num[3:]) + 1 sum0 = sum([int(num) for num in str(a)]) sum1 = sum([int(num) for num in str(b)]) sum2 = sum([int(num) for num in str(c)]) if abs(sum0 - sum1 == 0) or abs(sum0 - sum2 == 0) or abs(sum1 - sum0 == 0) or abs(sum2 - sum0 == 0): print("Yes") else: print("No") |
| Wrong answer UPD: solved | dry9goincer | 1001. Обратный корень | 7 мар 2023 20:37 | 1 |
using System; public class Reverse { private static void Main() { string[] numbers = Console.ReadLine().Split(new char[] {' ', '\t', '\n', '\r'}, StringSplitOptions.RemoveEmptyEntries);
for(int i = numbers.Length-1; i >= 0; i--) { double result = Math.Sqrt(double.Parse(numbers[i])); Console.WriteLine($"{result:F4}"); } } } Edited by author 07.03.2023 20:45 |