Show all threads Hide all threads Show all messages Hide all messages |
Got AC with random algorithm | Deepesson | 1548. Sakura and Statistics | 23 Apr 2024 03:52 | 1 |
After cracking my brain for 2 weeks in the search of the polynominal solution, I decided to use my observations to code the most optimized random algorithm I could think of. Surprisingly, I didn't even have to use simulated annealing: hill climb was enough. I also have 2 optimizations that I planned to implement but didn't have enough time. I was expecting very strong tests considering all the dramatic comments from coders way better than me. Maybe it's only a matter of time before admins add new tests that crack my solution, but I can't think of a single test that is strong enough to survive all optimizations... I'm extremely curious about the polynominal solution, so maybe I will continue thinking about this problem... But it's so incredibly hard... |
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) |
What algo? | bsu.mmf.team | 1842. Local Roots | 18 Apr 2024 22:03 | 6 |
Finally I've solved this problem using very hard optimised Main & Lorentz's algo, and 0.405s only. But I noticed many people solved this problem very fast and using much less memory. What algo do you use? I doubt it's possible to speed-up Main & Lorentz or Crochemore algos so much. Is it some alternative (like suffix tree) solution, or just some strong idea can be applied to this particular problem? Is it possible to solve it in O(n)? I use something similar with manacher algorithm with some optimization.. I use this approach: first for every position find the answer which cover outside the string(using kmp algo) as estimate value, and sort the estimate value in desending order, then use bruteforce(hash+enum) to calc the answer inside the string.when estimate value <=ans break; this program make me 0.2s AC... Thank you, but your solution is either not very fast :) I believe there's a strict approach exists with a strict algo for this problem. My algorithm is similar to Shen Yang.But I also use exkmp to calc another two situaion. Then the estimate value will become smaller.I got AC in 0.046s. Look up Critical Factorization Theorem |
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 |
I don't understand the question. Help !! | Rithik Linkon Penaru | 1083. Factorials!!! | 13 Apr 2024 17:23 | 1 |
Can Anyone be kind enough to explain this ques to me? I'll be grateful to you.. |
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] |
WA 4 | tima20072007 | 1881. Long problem statement | 4 Apr 2024 21:45 | 1 |
WA 4 tima20072007 4 Apr 2024 21:45 Не вздумайте решать задачу, оно того не стоит. |
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 |