| Show all threads Hide all threads Show all messages Hide all messages |
| help (python) | quarylaniel | 2100. Wedding Dinner | 10 Sep 2023 19:31 | 2 |
n = int (input()) cnt = 0 for i in range (n+1) : a = input() if a[-4:] != "+one" : cnt += 1 if a[-4:] == "+one" : cnt += 2 if cnt != 11 : print ((cnt * 100) + 200) if cnt == 13 : print ((cnt * 100) + 300) Runtime error,what's wrong? Edited by author 02.03.2022 22:29 |
| Idea | InstouT94 | 2171. Two Progressions 2 | 8 Sep 2023 23:23 | 1 |
Idea InstouT94 8 Sep 2023 23:23 To solve the problem, you can use the inclusion-exclusion principle. The intersection of two arithmetic progressions can be found by solving the Diophantine equation. If the difference in the new progression is too large, you can replace it with n+1. It should be noted that the first element of the new progression must be no less than the first elements of the intersecting progressions. You should also consider possible type overflows. My implementation uses int128, but I think it is possible to solve it using int64. Edited by author 15.07.2024 15:28 |
| To admins: error in problem statement | Otrebus | 2158. Two progressions | 5 Sep 2023 04:25 | 2 |
In the example outputs there's no third line containing the geometric progression like the problem states there should be. |
| Why is newest problems can't reach to 0.001sec solution ? )) | coder | 2158. Two progressions | 5 Sep 2023 04:14 | 3 |
WA#29 ant hint for this tricky test case? I make lots of random cases but still no help :-( For this particular problem I think the input size matters. It allows getting 0.001 sec on every test after few retries. But it makes it hard to get 0.001 sec on all tests in a single try. |
| When K = 1 , removed a single cell from line ? | coder | 1529. Game of Squares | 4 Sep 2023 21:41 | 2 |
When K = 1 , removed a single cell from line? If that right, K = 1 very simple case: n1 % 2 = 0 lost, n%2 =1 win position (with index=1). For K= 2, seems there only 2x2 rectangle Bob is win :) |
| For WA6 | bashNewbie | 1752. Tree 2 | 2 Sep 2023 11:48 | 1 |
For WA6 bashNewbie 2 Sep 2023 11:48 Try 12 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 1 9 9 10 10 11 11 12 2 6 |
| is there O(log) sol??? | Shen Yang | 2043. Kirill the Gardener 2 | 1 Sep 2023 14:41 | 2 |
there are 15 ms sols on the status?? so I guess there is O(log) maybe constraint is too small,and there need another version... There O(10^6) solution :) See min(row,col) <= 10^6 |
| For java solution who get WA 12 | taodaling | 1074. Very Short Problem | 30 Aug 2023 20:39 | 1 |
The test case contains some unexpected symbols, I don't sure which one, but if you're trying read line by yourself, you're quite likely to get Output limit exceeded. Just try below code to read from stdin BufferedReader bis = new BufferedReader(new InputStreamReader(System.in)); String line = bis.readLine(); |
| how to easily solve this problem | 👑TIMOFEY👑`~ | 1759. Long-Livers | 30 Aug 2023 10:49 | 1 |
|
| C# and out of memory | Pavel | 1510. Order | 29 Aug 2023 01:29 | 3 |
If you are using C# and running out of memory somewhere at test 36 think how to gracefully call the GC because the heap is full of strings u read from console. Thanks a lot. I thought that I need to use some other algorithm, because I just created a dictionary with the bill key and value counter++ then did sorting through the Linq and it's definitely inefficient, but in I still succeeded. I inserted a GC.Collect() for every 1000 iterations of reading and I passed all the tests. Edited by author 24.10.2021 18:54 Thank you, i get tired of this problem <3 |
| OMG I GOT AC | 👑TIMOFEY👑`~ | 1546. Japanese Sorting | 28 Aug 2023 16:36 | 1 |
try to figure out how sorting in Japanese differs from regular sorting, there really isn’t such a big difference, but there will also be one trick with which you will need to suffer |
| WA33 | 👑TIMOFEY👑`~ | 2074. Timus problems classifier | 28 Aug 2023 14:54 | 1 |
WA33 👑TIMOFEY👑`~ 28 Aug 2023 14:54 u can have some problems with fourth condition, like convert char to string or something like this 20. vector 1241 |
| RE 32 | 👑TIMOFEY👑`~ | 2074. Timus problems classifier | 28 Aug 2023 14:41 | 1 |
RE 32 👑TIMOFEY👑`~ 28 Aug 2023 14:41 ``` Topic id is a sequence <number>.<number>. ... <number>. All numbers are integers from a segment [1, 20] and have no leading zeroes. All topic id’s are unique. ``` try test: 1. graphs 1022 1065 2. geometry 1020 2.1. idea 1130 2.2. technique 1111 1065 1265 2.2.1. convex hull 1271 3. dynamic programming 1244 20. vector |
| wa7 | 👑TIMOFEY👑`~ | 1378. Artificial Intelligence | 26 Aug 2023 17:11 | 1 |
wa7 👑TIMOFEY👑`~ 26 Aug 2023 17:11 the sides of the square may not be parallel to the sides of the field |
| WA5 | 👑TIMOFEY👑`~ | 1468. Fraction | 26 Aug 2023 15:29 | 1 |
WA5 👑TIMOFEY👑`~ 26 Aug 2023 15:29 you put the first parenthesis (in the wrong place |
| TLE3 | 👑TIMOFEY👑`~ | 1468. Fraction | 26 Aug 2023 15:28 | 1 |
TLE3 👑TIMOFEY👑`~ 26 Aug 2023 15:28 try to remove all the crutches that you wrote in your code, which are very convenient, but at the same time only slow down your code |
| WA2 | 👑TIMOFEY👑`~ | 1468. Fraction | 26 Aug 2023 15:27 | 1 |
WA2 👑TIMOFEY👑`~ 26 Aug 2023 15:27 do not be smart in the code, do not add many characters at once, try to think step by step |
| TLE 10 | 👑TIMOFEY👑`~ | 1486. Equal Squares | 26 Aug 2023 08:45 | 1 |
TLE 10 👑TIMOFEY👑`~ 26 Aug 2023 08:45 use sort instead of map or unordered_map, its around 10 times faster |
| AC at last! | iceswanX | 1033. Labyrinth | 24 Aug 2023 14:22 | 5 |
i got WA because i don't realize that from the upper left to the bottom right there is no guarantee that they are connected. I also got WA because of it. I thought that upper left is entrance and bottom right is exit! Oh, god! You guys are so smart! I ran into the same trap and got AC following your hints. Thanks a lot! Yeah I thought same thing! I also had the same problem, 2 entrance one is upper left, one is lower right, both are open and no wall, :) (after spending more than 4 hour!) |
| I have a test and an AC (greedy) program, that gives WA on my test | Vadim Nikulin | 1182. Team Them Up! | 22 Aug 2023 20:06 | 6 |
Sorry, the test is not small. Now I will give a description of the test. There 5 groups with sizes: (6 1) (5 1) (4 1) (4 1) (4 1). The right answer for this test is 14:14. But the greedy program gives 15:13. I think moderators shall add this test to the test data and many solutions will be rejected. 28 21 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 2 3 4 5 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 22 1 2 3 4 5 6 7 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 0 23 1 2 3 4 5 6 7 8 9 10 11 12 13 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 15 17 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 17 19 20 21 22 23 24 25 26 27 28 0 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 21 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 22 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 23 24 25 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 24 25 26 27 28 0 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 26 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 27 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 28 0 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 0 Do judges want to break greedy wrong solutions? Or it is OK that they are accepted? It is strange, that NEERC problem has poor set of tests. DO NOT MISLEAD OTHERS WITH YOUR WRONG SAMPLE!!! MY AC program says NO SOLUTION! take care of the following nodes 1st group: 1 8 14 19 24! 26 2nd group: 2 3 4 5 6 7 9 10 11 12 13 15 16 17 18 20 21 22 23 24! 25 27 28 when you start deducting from 24 to other non connected with 24 nodes and so on, you will get a contradiction. My AC prog says 14 24 19 14 9 10 11 12 13 2 3 4 5 6 7 14 1 8 15 16 17 18 20 21 22 23 25 26 27 28 |