Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @yoch,validated by @cedricdd,@Timinator and @Lanfeust.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @yoch,validated by @cedricdd,@Timinator and @Lanfeust.
If you have any issues, feel free to ping them.
Is this even solvable in c? i feel like execution delays are insanely restrictive is it just on that particular language? i’ve tryed a lot optimizing tricks bit masking linkchaining and list checking paired with row/column/block counters to auto out singles and nothing seems to works, im runing out of ideas? all other ideas i have litteraly take to me to c# or c++…
C is one of the fatest languages, and I can see that some people made it in python, so you definitively can make it in C. I didn’t make it so I can’t help you about ideas.
I solved it in Python with the mixed integer linear programming module from Scipy, so it’s technically Cython not pure Python, but solved the worst case in less than 500ms. You can certainly do better in C. The other Python solutions here are using a very popular algorithm. If you search for sudoku solving algorithms you’ll find it.
‘technically C’ in Python means a benefit in time of about 10x versus really in C, since time limit for C in puzzles is about ten times lower than for Python, right?
From my experiments, it’s more like 20x, but the MILP approach is terribly inefficient. I used it because I’m practicing it, not to avoid the time limit. The pure Python solutions using better algorithms still finish well below the time limit.
Anyway, it’s certainly possible to solve this in C because there’s one published solution here. It’s not easy, it’s a Very Hard puzzle after all, but it’s definitely possible.