| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Cool problem! My method. | jagatsastry | 1515. Финансовая реформа | 9 ноя 2023 13:53 | 5 |
Wow. This problem is really cool. Try using the naive method and you're sure to get TLE#26. Well, my solution(AC 0.234) goes this way: if the first term is not 1 then the ans is 1. if the first i terms are 1<<0, 1<<1, 1<<2, ... 1<<(i-1) then all numbers from 1 to (1<<i) - 1 can be expressed as a sum of some of the above terms. Thus if a number k is present all numbers from k to k+((1<<i) - 1) can be skipped. Proceed using this approach. By the way 1<<i represents pow(2, i). And how do you plan to proceed with this approach? :) how is your algorithm working on this test: 6 1 2 3 6 9 18 My brain burned in notebook on that algorithm! |
| WA7 | andreyDagger`~ | 1839. Ментакулус | 9 ноя 2023 00:56 | 1 |
WA7 andreyDagger`~ 9 ноя 2023 00:56 1 5 -9 2 0 0 4 2 -2 5 -4 6 0 4 -6 7 2 3 Answer: 0 |
| If you have WA14...... | AleshinAndrei | 1215. Точность попадания снаряда | 9 ноя 2023 00:47 | 2 |
Can someone proceed further on this topic? I have a WA14, and I literally can use only double in my program, so int64_t doesn't really help. |
| I don't undesrstand where is a mistake. Who can help? | Danis | 1001. Обратный корень | 6 ноя 2023 18:42 | 1 |
lines = [] for line in stdin: for i in range(0, len(line.split())): lines.append(line.split()[i]) lines = [int(i) for i in lines] lines_rev = list(reversed(lines)) numbers = [] for i in range(0, len(lines_rev)): numbers.append(lines_rev[i]**0.5) for i in range(len(numbers)): print(f"{numbers[i]:.4f}") |
| checker failed | andreyDagger`~ | 1859. Последний сезон Team.GOV | 6 ноя 2023 01:16 | 2 |
|
| RE16 | Arseny Babushkin (aytel) | 1587. Летающая свинья | 6 ноя 2023 00:29 | 2 |
RE16 Arseny Babushkin (aytel) 20 авг 2016 14:27 I've got many RE16 with using python 3.4. Did anybody else get it? How did you solve it? I don't know why , but I just stopped using division in my solution and got AC! |
| Ac Pythoh !!! | eremeev.me.2012@gmail.com | 2056. Стипендия | 5 ноя 2023 21:27 | 1 |
a = int(input()) f = [] for i in range(a): s = int(input()) f.append(s) if f.count(3) >=1: print('None') else: if f.count(5) == len(f): print('Named') elif sum(f) / len(f) >=4.5: print('High') else: print('Common') |
| Test 1 , WA | alennv | 2020. Пробка в Цветочном городе | 5 ноя 2023 02:37 | 2 |
Can anyone give tests data or some discription? Edited by author 01.11.2023 14:24 Test 1 is the first sample test from the problem statement. |
| useful test | anotherworld | 1940. Непростые годы | 4 ноя 2023 02:12 | 1 |
1000000000 1000000000 300 answer: 97395891 |
| Test for WA 21 | Yiumacj `~ | 1888. Стаж пилотов | 30 окт 2023 20:11 | 1 |
|
| Better Understanding of states | Amil Khare | 2018. Дебютный альбом | 30 окт 2023 12:59 | 2 |
Hello, I am trying this question, however, I am unable to understand how to construct the solution. My Dp is weak so I thought to practice here, however I am having a tough time. Can someone please help in describing how to start thinking about such problems? |
| WA3 | 👑TIMOFEY👑`~ | 1592. Китайские часы | 30 окт 2023 09:51 | 1 |
WA3 👑TIMOFEY👑`~ 30 окт 2023 09:51 we have 12 hours on clocks |
| WA10 | Yury_Semenov | 1678. Космический покер 3 | 28 окт 2023 15:22 | 1 |
WA10 Yury_Semenov 28 окт 2023 15:22 If you have WA10, make sure you don't have 'I' as a card value instead of 'T'. For some reason it was very easy for me to mix these letters in the statement... |
| how do it more simply | 👑TIMOFEY👑`~ | 1116. Кусочно-постоянная функция | 27 окт 2023 01:13 | 2 |
u can search for intersections instead of looking for cutouts, just invert the segments of the second function use min max instead of a lot of conditions and you get a very simple code :) Simpler is to brute-force |
| Does the greedy solution work? | InstouT94 | 1782. Новое слово Джека | 21 окт 2023 16:50 | 1 |
My idea is to reverse the operations of adding characters and doubling a string. I have an iterative algorithm in O(n * log(n)). At each iteration, I count dp - the length of the maximum substring ending with index i, obtained by the doubling operation. Then I look for the maximum among the maximum substrings and truncate the current string to leave this substring. But this is a greedy solution. Is it possible to come up with a counterexample to it? |
| checker failed | [ZXC] ульяночку бы | 1954. Пять палиндромов | 21 окт 2023 01:29 | 1 |
admins, could you pls fix this? |
| Little Guide | Mickkie | 2042. Никита | 21 окт 2023 00:05 | 1 |
My first attempt use string hashing to check the palindrome with Segment Tree lazy prop. O(Q*K*logK*logN), esp. for the update query and it's TLE 11 However, using Manacher algorithm with Segment Tree you can achieve O(Q*(K+lgN)) Little help: - WA#3 : You're likely answering too much. (K involved) - WA#9 : N=10^5, overflow somewhere |
| WA №16 | Mihanaz | 1497. Разрезание квадрата | 20 окт 2023 17:05 | 4 |
WA №16 Mihanaz 27 апр 2011 14:41 Help! What is wrong? [code deleted] Edited by moderator 05.11.2023 02:38 maybe this test can halp you? 5 00000 01111 01111 01110 00000 I also had WA 16, turns out this was the reason: 5 11100 10000 00011 11000 00000 In this test, i assumed that you can move away parts with 1's, thus separating 0's from everything. But it turns out to be wrong, you're only allowed to move zeros, and ones stay fixed in place. |
| Помогите пожалуйста, разве это неверное решение (PascalABC) | Ahmet | 1068. Сумма | 19 окт 2023 22:38 | 1 |
var N: integer; begin readln(n); if (abs(n)>10000) then writeln('Îøèáêà ââîäà') else if N>=0 then writeln(((1+n)*n)/2) else writeln(((1+n)*(abs(n)+2))/2); end. |
| Почему не засчитывает?Why does not count?№1068.PascalABC | Yura | 1068. Сумма | 19 окт 2023 22:35 | 3 |
var a: integer; b: real; begin readln(a); if (abs(a) < 10001) then begin if (a < 0) then b := (a + 1) * (-a + 2) / 2 else b := 0; if (a > 0) then b := (a + 1) * a / 2 else if (a < 0) then b := (a + 1) * (-a + 2) / 2 else b := 1; writeln(b); end; end. Я так понимаю, ты используешь тип real для b, потому что / не работает. Следует помнить, что для целочисленного деления нужно использовать div, а не /. То есть, вариант 1 — заменить b: real на b: integer и все / на div. Вариант 2 — можно продолжать использовать /, но вместо writeln(b) следует написать writeln(b:0:0) (второе :0 — количество знаков после запятой для вывода). Также, проверки типа if (abs(a) < 10001) не нужны — если в задаче сказано о таком ограничении на входные данные, значит в тестах так честно и будет, и не нужно это проверять. А у меня тоже такая же проблема: var N: integer; begin readln(n); if (abs(n)>10000) then writeln('Îøèáêà ââîäà') else if N>=0 then writeln(((1+n)*n)/2) else writeln(((1+n)*(abs(n)+2))/2); end. IS that wrong answer? |