| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Прикол!!! | Shady TKTL | 1012. K-ичные числа. Версия 2 | 24 ноя 2024 02:48 | 9 |
когда я с длинной арифметикой сделал эту задачу я использовал в качестве основы 10000 и у меня был WA#7 тест потом я сделал снову 10 и у меня был WA#2 тест тогда подумав решил использовать EXTENDED всеравно WA#6 тест кто подскажет как преодолеть 2, 6, 7 тесты Use base = 10 compare small answers with 1009 I compaired it My program gives equal answers in all cases Use Java's BigInteger I always use it then long arifmetic is needed. Помоему он подсовывает во 2 тесте N=170 и K=10 Если умножать пллучается 10 с 170 нулями. Никакой тип не выдержит. Надо разбивать число на группы. Только какие? Edited by author 11.06.2008 17:47 174568663359808123517619015636369512622213 064344534689513998708986681415716975079951 752754958954321404709642918328732491072229 658639887075761909680804620151071937764270 946419913401 Edited by author 29.10.2008 11:30 Пока не использовались ostream манипуляторы setfill('0')\setw(9) а использовались только fill('0')\width(9) программа не выводила ведущие нули. AC https://acm.timus.ru/getsubmit.aspx/10809916.cppWA7 https://acm.timus.ru/getsubmit.aspx/10809884.cppЛибо я что-то не понял, либо это ошибка в STL. Надо чтобы админы проверили. P.S. My English is too bad. Понял. Не ошибка STL. Фича. В документации написано (на ангельском языке): Глобально установленная ширина поля имеет право портиться. Edited by author 25.11.2024 04:43 |
| Why so easy? | Timur | 1731. Укроп | 19 ноя 2024 22:44 | 1 |
|
| Wa is re | 👑TIMOFEY👑`~ | 1861. Кладбище в Дейе | 19 ноя 2024 16:02 | 1 |
If you have an absolutely useless piece of code in your code that is not used anywhere, but it has an error going out of bounds, then this may instead affect the execution of the rest program |
| Hint about wa 9 | Hououin`~`Kyouma | 1357. Чайник для чайников | 15 ноя 2024 19:55 | 1 |
Round(time) instead of Ceil(time) |
| WA in test 5 | Daniel | 1215. Точность попадания снаряда | 14 ноя 2024 23:24 | 1 |
What should i check if i have WA in test 5? |
| Am I using correct approach? | sleepntsheep | 1632. Лазеры | 14 ноя 2024 16:59 | 1 |
|
| Hint about ml 3 | Hououin`~`Kyouma | 1097. Квадратная страна 2 | 12 ноя 2024 20:37 | 1 |
Delete a rectangle if there is another one covering this one |
| Why does a simple sort of pairs + finding the median not work? | sweepea | 1207. Медиана на плоскости | 12 ноя 2024 14:43 | 2 |
All the test cases I've come up with have been solved correctly by this method but no AC :( code: ``` #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<int>> x(n, vector<int>(3, 0)); for (int i = 0; i < n; i++) { cin >> x[i][0]; cin >> x[i][1]; x[i][2] = i + 1; } sort(x.begin(), x.end()); auto med = (n - 1) / 2; cout << x[med][2] << " " << x[med + 1][2]; } ``` Edited by author 11.11.2024 16:23 Edited by author 11.11.2024 16:23 To answer my own question. The above code will select for the 2 median points. These don't necessarily create a median line. Consider the following test case: 4 0 10 1 1 2 2 3 10 The above alogorithm would select (1, 1) and (2,2), which partitions the plane into a section with 2 points, and a section with 0 points; the above approach is incorrect. |
| for All of Programmers | Adhambek | 1642. Одномерный лабиринт | 11 ноя 2024 19:09 | 8 |
Test 3 : input : 5 2 -1 -2 -3 -4 -5 output : 2 4 Test 4 : input : 2 0 1 -5 output : 0 0 Test 5 : input : 15 23 252 33 215 789 1000 123 -125 29 -45 -450 121 -555 -72 120 123 output : 23 113 Test 6 : 0 213 output Impossible Test 7 : input : 8 12 1 2 3 4 5 6 7 8 output : Impossible Test 10 : input : 0 0 output : 0 0 Test 15 : input : 2 12 1000 -1000 output : 12 2012 Тест 4 точно не такой. По условию сказано, что x!=0. Я проверял, во всех тестах x!=0. Тест 10 тоже не такой. Edited by author 28.01.2014 07:04 Edited by author 28.01.2014 07:05 правильно подметил Vitaliy. Еще возможен такой вариант : input : 3 2 0 -2 4 output : Impossible Невозможен, "Все координаты, включая x, не равны нулю" You have an error in tests 4 and 10: "Each coordinate, including x, is non-zero and doesn't exceed 1000 in absolute value." 15 isn't it. I have WA15, but on this test my program outputs right answer |
| Hi read this!!!!!! | Turdubek | 1025. Демократия в опасности | 11 ноя 2024 03:05 | 2 |
Send me the answer or I'll kick you! |
| Куда делась задача 1785 ? | Oleg Vasilenko (Chelyabinsk) | | 9 ноя 2024 20:19 | 3 |
Почему задачу 1785 нельзя отправить на проверку и почитать её условие, однако она идёт в зачет количества решенных задач? Чтобы новые пользователи никогда не могли решить все задачи? Так что ли? Thanks for raising the issue. The problem is restored. |
| [TO ADMINS] Rust compiler: edition 2021 | Yury_Semenov | | 9 ноя 2024 17:50 | 5 |
Hi, I've got a compilation error in Rust (id: 10760679) because of a feature that appears in edition 2021, and the compiler on Timus uses some previous edition. Any plans to compile Rust code in edition 2021? It's already 2024 and the edition is stable (in fact, a newer edition will be released in several months), so it makes no sense to stick to an older edition. The current version of Rust compiler is 1.75.0, which was released on 28 December, 2023. Thanks for explanation. The command line changed to: rustc -O --edition 2021 %1 |
| 2103 Checker failed | Igor Parfenov | | 9 ноя 2024 03:02 | 2 |
Starting from my second attempt (first was WA) I am always getting "Checker failed" independently of the code. Even, if I submit the first attempt's code, which was WA. I see that my submissions were tested. But there is still a problem: I suspect, that checker is not correct, as it rejected another optimal answer. Compare submissions 10791903 and 10791934 : they have only difference in "<" / "<=" in "if (d[..] < answer) { ..update answer..}". One of them is AC, another one is WA40. |
| Wa 11 | Hououin`~`Kyouma | 2117. Полифемовы тройки | 6 ноя 2024 21:29 | 1 |
Wa 11 Hououin`~`Kyouma 6 ноя 2024 21:29 Sqrtl is inaccurate, check the numbers next to it |
| Nice problem (-) | Al.Cash | 1848. Охота на мух | 6 ноя 2024 00:04 | 3 |
Your algo is based sweep line or other ? |
| WA 14 | ~'Yamca`~ | 1848. Охота на мух | 6 ноя 2024 00:03 | 1 |
WA 14 ~'Yamca`~ 6 ноя 2024 00:03 I think, you should delete old segment before add new. I had wa14 until i do this and get AC) вообще, в чем смысл писать на английском, если подовляющее большинство посетителе сайта знают русский? кароч, я не смог придумать тест который у меня бы все ломал, но когда поправил эту багу, все стало хорошо) |
| Deleted | Hououin`~`Kyouma | 1382. Игра с карточками | 3 ноя 2024 19:46 | 1 |
Deleted Hououin`~`Kyouma 3 ноя 2024 19:46 Edited by author 10.08.2025 21:25 |
| Easy idea, but clay realization | Hououin`~`Kyouma | 1850. Космический туризм | 3 ноя 2024 12:32 | 1 |
|
| AC but memory is bad | coolboy19521 | 1452. Pascal против C++ | 3 ноя 2024 11:07 | 2 |
How can I improve memory usage in this code? #include "bits/stdc++.h" using namespace std; int main() { cin.tie(nullptr)->sync_with_stdio(false); short n; cin >> n; vector<pair<int,short>> s(n, pair<int,int>()); for (int i = 0; i < n; i ++) { cin >> s[i].first; s[i].second = i; } sort(begin(s),end(s)); for (short i = 1; i < n; i ++) { if (s[i].first == s[i - 1].first) { s.erase(begin(s) + i); n --; i --; } } vector<vector<short>> dp(n + 1, vector<short>(n + 1, 0)); for (short i = 1; i < n - 1; i ++) { short l = i - 1; short r = i + 1; while (0 <= l && r < n) { int dfl = s[i].first - s[l].first; int dfr = s[r].first - s[i].first; if (dfl == dfr) { dp[i][r] = dp[l][i] + 1; l --; r ++; } else if (dfl > dfr) { r ++; } else { l --; } } } if (1 == n) { cout << "1\n1\n"; } else { short mx = -1; short di = 0; short dj = 0; for (int i = 0; i < n - 1; i ++) { for (int j = i + 1; j < n; j ++) { if (dp[i][j] >= mx) { mx = dp[i][j]; di = i; dj = j; } } } int df = s[dj].first - s[di].first; mx += 2; cout << mx << '\n'; for (; -1 < di;) { cout << s[dj].second + 1 << ' '; dj = di; di = -1; for (short i = 0; i < dj; i ++) { if (s[dj].first - s[i].first == df) { di = i; break; } } } cout << s[dj].second + 1 << '\n'; } } Don't use std::vector at all. Especially for 2D arrays. Vector can be twice more than you suppose ) |
| WA30 | Felagund | 1583. Сыр | 2 ноя 2024 19:38 | 1 |
WA30 Felagund 2 ноя 2024 19:38 Could you please give any hints or tests? |