| Show all threads Hide all threads Show all messages Hide all messages |
| Why so easy? | Timur | 1731. Dill | 19 Nov 2024 22:44 | 1 |
|
| Wa is re | 👑TIMOFEY👑`~ | 1861. Graveyard in Deyja | 19 Nov 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. Teakettle 1.0 for Dummies | 15 Nov 2024 19:55 | 1 |
Round(time) instead of Ceil(time) |
| WA in test 5 | Daniel | 1215. Exactness of Projectile Hit | 14 Nov 2024 23:24 | 1 |
What should i check if i have WA in test 5? |
| Am I using correct approach? | sleepntsheep | 1632. Lasers | 14 Nov 2024 16:59 | 1 |
|
| Hint about ml 3 | Hououin`~`Kyouma | 1097. Square Country 2 | 12 Nov 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. Median on the Plane | 12 Nov 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. 1D Maze | 11 Nov 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. Democracy in Danger | 11 Nov 2024 03:05 | 2 |
Send me the answer or I'll kick you! |
| Куда делась задача 1785 ? | Oleg Vasilenko (Chelyabinsk) | | 9 Nov 2024 20:19 | 3 |
Почему задачу 1785 нельзя отправить на проверку и почитать её условие, однако она идёт в зачет количества решенных задач? Чтобы новые пользователи никогда не могли решить все задачи? Так что ли? Thanks for raising the issue. The problem is restored. |
| [TO ADMINS] Rust compiler: edition 2021 | Yury_Semenov | | 9 Nov 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 Nov 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. Polyphemus' triples | 6 Nov 2024 21:29 | 1 |
Wa 11 Hououin`~`Kyouma 6 Nov 2024 21:29 Sqrtl is inaccurate, check the numbers next to it |
| Nice problem (-) | Al.Cash | 1848. Fly Hunt | 6 Nov 2024 00:04 | 3 |
Your algo is based sweep line or other ? |
| WA 14 | ~'Yamca`~ | 1848. Fly Hunt | 6 Nov 2024 00:03 | 1 |
WA 14 ~'Yamca`~ 6 Nov 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. Game with Cards | 3 Nov 2024 19:46 | 1 |
Deleted Hououin`~`Kyouma 3 Nov 2024 19:46 Edited by author 10.08.2025 21:25 |
| Easy idea, but clay realization | Hououin`~`Kyouma | 1850. Space Tourism | 3 Nov 2024 12:32 | 1 |
|
| AC but memory is bad | coolboy19521 | 1452. Pascal vs. C++ | 3 Nov 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. Cheese | 2 Nov 2024 19:38 | 1 |
WA30 Felagund 2 Nov 2024 19:38 Could you please give any hints or tests? |
| Why RA 12? | Luara_A24 | 1225. Flags | 29 Oct 2024 15:59 | 1 |
#include <iostream> using namespace std; int main() { int n; cin >> n; long a = 1; long b = 1; long ans = 0; if(n == 1 || n == 2){ ans = 1; } else { while (n - 2 > 0){ ans = a + b; a = b; b = ans; n--; } }
cout << 2 * ans; return 0; } |