Back to General discussions forum
This is intended to be a fairly straightforward problem, although some thought is needed for an efficient solution.
Impossible to solve... One must consider 2^400000 - 1
combinations in third example, this is obviously too much.
Nevermind, I didn't notice that someone already solved this problem, sorry!
Generally speaking, counting how many does not necessarily imply actually going through all possibilities. The 2^40000 number is a major hint for you not to do that.
That said, I wish I had more time to work on CodeAbbey problems these days; work has been busy.
...and THAT said, this is a great problem, and I fully encourage y'all to work on it.
Thanks, Clive!
Impossible to solve
Just thought the same yesterday, when received the problem from Clive!
However yesterday was an annoying busy workday - and today at morning I tried to think carefully - as many Clive's problems are DP-based, how could this be done step by step. Perhaps Clive's puzzles are one of the best sources to train one's skills in this direction.
Solution soon started to dawn in my head, but I'm amazed I was able to compose these dozen lines at last - it took perhaps couple hours of slow thinking on a small example. This reminds me one of the first problems proposed by Clive, about train merging.
I join Vladimir (zelevin) in praising the puzzle - it really allows to work out solution by and by, not demanding to know some clever algorithms and anything besides arithmetics...
One must consider 2^400000 - 1 combinations
Yep, in such problems (especially when Clive asks for result to be given by modulo of some large value) - the problem size is a blatant hint that one must not consider brute-force approach :)
Do you mean this new user named Luis? I guess ChatGPT was here for quite some time already (I wrote before) - but I thought mainly for rewriting other code...
Thank you. It's funny of course to see the person do not use input()
anywhere except the most recent problem(s).
Let's allow him to waste some more efforts and wipe solutions bit later %)
What's the point making ChatGPT solve problems from here instead of coming up with the solution yourself?
It's so much more exciting when your method actually solved the problem despite it seeming impossible to solve at first glance.
On the other hand, who am I to judge anyone.
It seems some amount of students are driven here by their professors with order to have such a number of problems solved or such a number of points gained (judging by someone's profile info). For them there is no much excitement in solving I guess :)
I looked into "Funny Words Generator" solution and tried to ask DeepSeek
I need your help in deciding whether code in Python is written by student or generated by ChatGPT
after kiloton of verbose exchange and passing sample to it, the last answer ended with:
The code leans slightly more toward ChatGPT-generated due to:
Idiomatic generator usage (yield, infinite loop).
Clean but minimal docstrings (ChatGPT often adds them even when unnecessary).
Lack of edge-case handling (ChatGPT assumes happy-path unless asked).
Boilerplate (if __name__ == "__main__" for a small script).
...
How to Confirm?
Ask the student:
"Why did you use % 19 and % 5 instead of len(CONSONANTS)?"
A student might say, "I counted the letters," while ChatGPT would explain modulo arithmetic.
"What happens if the seed is negative?"
A student might not know; ChatGPT would explain the modulo behavior.
Funny ideas. We shall try of course, but obviously these things become cunning nowadays. It offers help in rewriting code in "more student-like style"...
This fellow Luis added a few more problems and seemingly is following suit. His account is blocked now.
I would ask a hint (from Mathias or whoever is able to make it work) - do you feed all this lengthy enough problem description (for this one, with string concatenations and modulo 13) to ChatGPT and it immediately spits out the solution - or need to simplify request somehow?