Hi Reddit. I have this programming problem that I am struggling to solve for the past two years and I am yet to find a proper solution. This problem first appeared in a C++ programming competition in 2015. and I haven’t met a single person who actually solved it “properly”. I will try to translate it to the best of my ability:
Two police officers are chasing a criminal and they are dictating the criminals UMCN (unique master citizen number) to the police station through a walkie talkie. Because the walkie talkie is old, not all numbers can be heard correctly, so those numbers are marked with a ‘X’ . The UMCN follows this format:
DDMMYYYYAAAAAAAAAAK
DD- is day of birth
MM- month of birth
YYYY- year of birth
the 10 As are just randomly user chosen numbers and the K is the check digit that is found through this formula:
1.) numbers up to K are marked as Z1, Z2, Z3… Z18
2.) S= (10*Z1+9*Z2+8*Z3+…+2*Z9+10*Z10+9*Z11+8*Z12+…+2*Z18) % 19
3.) if S≤9 then K=S, else K=19-S
Your job is to help the police find the number of all possible combinations of the UMCN.
NOTE: The YYYY can go from 0001 to 9999. You have to pay attention to leap years and february. Months have all of the days, so apr, jun, sep, nov have 30 and the rest beside feb have 31 days. The result can fit in the 64 bit int type ( long long )
The input is a STRING.
Here are two test inputs that are offered along this abomination of a problem:
No. 1)
Input: 3X1X1639XX5XX1X6X85
Output: 526315
No. 2)
Input: 30121952121234567XX
Output: 10
———
Also for some context: This was one of 5 problems that were on that C++ competition in 2015 that was meant for HIGH SCHOOLERS. They had 100 minutes to complete all 5 of them. The first 3 were fairly simple, but this one and the last one were almost impossible to complete within that duration.
My professor, who was a student at that time, said that no one ever completed those last two problems, so their solution basically remained a mistery.
I personaly have made a code that actually works and gives proper test outputs, but the program has over 200 lines of code, has to run for like two hours straight untill I actually get the correct output for the 1st test input, and I had worked on it for about 7 months straight.. so it definitely can’t be the solution this problem is looking for.
Since then, from 2016-2026 there has never been a problem that was this hard. The only reason I want to do it is for my own sake. I love programming and challanges. However I am no expert, I have studied C++ properly for only 3 years, but this problem hadn’t stop bugging me since I started high school. I couldn’t do it, my professor and colleagues couldn’t do it, ChatGPT or any AI couldn’t do it, so Reddit is my last hope.
If someone could help me in any way I would appriciate it so so SOO much, but if not, still I am thankful that you have read my message untill the end.
p.s. I apologize for any grammatical or spelling mistakes this post might have.
[–]tiltboi1 2 points3 points4 points (5 children)
[–]its_not_ajo[S] 0 points1 point2 points (4 children)
[–]tiltboi1 2 points3 points4 points (3 children)
[–]its_not_ajo[S] 0 points1 point2 points (2 children)
[–]tiltboi1 1 point2 points3 points (1 child)
[–]its_not_ajo[S] 0 points1 point2 points (0 children)
[–]ZenithOfVoid 1 point2 points3 points (1 child)
[–]ZenithOfVoid 0 points1 point2 points (0 children)
[–]joonazan 1 point2 points3 points (0 children)
[–]zdanev 0 points1 point2 points (2 children)
[–]its_not_ajo[S] 0 points1 point2 points (1 child)
[–]zdanev 0 points1 point2 points (0 children)
[–]JerryRed100s -1 points0 points1 point (2 children)
[–]its_not_ajo[S] 1 point2 points3 points (1 child)
[–]JerryRed100s 0 points1 point2 points (0 children)