| Show all threads Hide all threads Show all messages Hide all messages |
| why its wrong? | Владислав | 1409. Two Gangsters | 19 Apr 2024 16:22 | 3 |
a, b = map(int, input().split()) print(10-a, 10-b) Их не обязательно 10! то есть всего банок a + b - 1 Total_Cans = a+b-1 then, print(Total_Cans-a, Total_Cans-b) |
| Statement clarification | Fajnyi | 1677. Monkey at the Keyboard | 18 Apr 2024 20:53 | 1 |
So clearly realising (if monkey will follow others then monkey never will create that word because of re-using letters)? |
| Tests | andreyDagger`~ | 2139. Experiment with Juice | 18 Apr 2024 20:46 | 1 |
Tests andreyDagger`~ 18 Apr 2024 20:46 4 1 0 3 0 3 2 1 2 3 1 0 Answers: 2.00000000 4 1 0 3 0 3 2 1 2 3 1 1 45 Answers: 2.00000000 2.00000000 4 1 0 3 0 3 2 1 2 3 1 2 45 -90 Answers: 2.00000000 2.00000000 0.50000000 4 1 0 3 0 3 2 1 2 3 1 2 -45 -45 Answers: 2.00000000 0.50000000 0.00000000 3 -2.000 1.000 1.000 -2.000 4.000 1.000 1.000 1.000 1 359 Answers: 9.00000000 0.00000000 |
| How to solve it in less one second | 8848mzy | 1504. Good Manners | 15 Apr 2024 20:02 | 3 |
Voroni diagrams perhaps (O(N*log(N)) I have AC 0.046s, O(K^3) with very simple approach |
| - | 💮meanlessnessener`~ | 2045. Richness of words | 14 Apr 2024 20:01 | 1 |
- 💮meanlessnessener`~ 14 Apr 2024 20:01 Edited by author 14.04.2024 21:19 |
| Help!!!! | IntoTheDusk | 1394. Ships. Version 2 | 12 Apr 2024 01:08 | 2 |
When I tried the brute force algorithm, I TLE at #15 How to solve this problem? Please send the solution to 13588731339@163.com 1) When bruteforcing, random shuffle both m rows and n ships 2) When solving one subset sum problem inside bruteforcing, use bitset (array of bitsets) instead of bool array (2d-array). Instead of max() in subset sum problem, use operator OR and operator "right bit shift". Just search "subset sum problem bitset" and you'll find out. This will speed up your dynamic programming in 32 or 64 times (if you are using both 64-bit compiler and 64-bit processor) It will not totally solve problem, but you will get TLE#67 which is better and giving more hope :) Edited by author 12.04.2024 01:08 Edited by author 12.04.2024 01:09 Edited by author 12.04.2024 01:11 |
| Brute Force | pocochuk | 1769. Old Ural Legend | 11 Apr 2024 03:49 | 1 |
|
| Did anyone solved this using rolling hash and unordered_map (HashMap)? | prituladima | 1706. Cipher Message 2 | 9 Apr 2024 12:02 | 1 |
I tried this approach with Java: Test 5. TL With C++: Test 9. TL And seems like this is not enough, however time complexity is O(αk^2 + α|S|*k) where α is hash map hidden constant. So... did anyone managed to solve it this way? |
| i solved dp[i] - the number of sequences of length i | >>> | 1081. Binary Lexicographic Sequence | 6 Apr 2024 22:41 | 3 |
dp[i][j] - amount of i-digit numbers ending with j. therefore we form 2d table dp[n][2] then dp[i][0] = dp[i - 1][0] + dp[i - 1][1] dp[i][1] = dp[i - 1][1] It's not hard to see that dp[i][0] + dp[i][1] (i.e. number of all valid sequences) forms a fibonacci sequence. dp[i][0] + dp[i][1] = 2*dp[i - 1][0] + dp[i - 1][1] you can treat as f_n = 2*f_(n - 2) + f_(n - 3) But still, I don't know how to solve this problem :) Edited by author 23.01.2022 01:36 Edited by author 23.01.2022 01:37 dp[i][1] = dp[i - 1][1] is wrong, should be: dp[i][1] = dp[i - 1][0] |
| Hint - Illustration | Daniil | 1893. A380 | 3 Apr 2024 19:41 | 2 |
( window | A | aisle |B C| aisle | D | window )-- Premium (1-2) ( window | A B| aisle |C D| aisle |E F | window )-- Business (3-20) ( window | A B C| aisle |D E F G| aisle |H G K | window )-- Economy (21-64) Edited by author 30.05.2022 16:38 |
| Slight Clarification | SquidBoy | 2056. Scholarship | 1 Apr 2024 13:02 | 3 |
It took me a while to get this one correct, and it's because I found part of the descritpion to be ambiguous/unclear - so I'm posting this clarification which hopefully will help anyone else who has the same misunderstanding. "if a student has got satisfactory marks, the scholarship is not given, " I read this to mean "got ONLY satisfactory marks" but my solutions were rejected. Once I modified my solution to treat it as "got ANY satisfactory marks", the solution was accepted. |
| Check this test case to avoid WA #4 | Newaz | 1581. Teamwork | 1 Apr 2024 11:04 | 1 |
First time I've got WA #4 because of this test case: Input: 6 1 1 2 1 1 1 Correct answer: 2 1 1 2 3 1 |
| Solution idea in C++ | Newaz | 1585. Penguins | 1 Apr 2024 10:04 | 1 |
Instead of using getline(cin, str), use two different string such as string s1, s2. Then compare s1! |
| Wrong test cases | pocochuk | 1984. Dummy Guy | 29 Mar 2024 08:40 | 1 |
When n > 6 the cases are wrong. Try to do it without placing a circle in the center. |
| Test 42 | BENDER | 1014. Product of Digits | 29 Mar 2024 02:32 | 2 |
How is it POSSIBLE to find 42 test case? It seems like everything should work fine.. OK, found my mistake. 777&222 would be very helpful test cases) |
| solved | Jakub Minarik | 1000. A+B Problem | 28 Mar 2024 16:13 | 1 |
solved Jakub Minarik 28 Mar 2024 16:13 already done. for someone who doesn't know how to do it: a,b = input().split() print(int(a)+int(b)) a = int(1) b = int(5) Edited by author 28.03.2024 16:23 |
| Is the segment close or open? | Ade [FDU] | 1469. No Smoking! | 28 Mar 2024 08:06 | 2 |
What the output of? 2 0 0 1 1 1 1 2 2 |
| WA in 11 test help please | Nabi | 1469. No Smoking! | 28 Mar 2024 08:03 | 2 |
i used redblack tree on python and using a quick input using stdin i passed test 8 time limit and met evening at 11 ok, it was a perpendicular but what about 15 test |
| Use cstdio | pocochuk | 1306. Sequence Median | 27 Mar 2024 05:35 | 1 |
|
| The most stupid solution | andreyDagger`~ | 1621. Definite Integral | 23 Mar 2024 21:40 | 1 |
Just run Simpson's method, you will only need to find suitable "a", "b" and "N" parameters, but it can be done easily with trial and error method |