[Community Puzzle] Blowing Fuse


#1

https://www.codingame.com/training/easy/blowing-fuse

Send your feedback or ask for help here!

Created by @java_coffee_cup,validated by @bbb000bbbyyy,@Niako and @GeoConHD.
If you have any issues, feel free to ping them.


#2

Hi there, i’ve been trying to solve this puzzle but i think i found an error on the expected result on the Case 04 ( More Devices ) or in the instructions: According to instructions one click will turn the device ON and a second will turn it OFF. Do it in by hand if thats the case:

Clicks - Device
1 - 10
2 - 0 - 10
3 - 10 - 0 - 14
4 - 0 - 10 - 0- 14
5 - 10 - 0 - 14- 0 - 14
6 - 0 - 10 - 0- 14 - 0 - 15

That means the Max AMP consumption is 39Amps when i click 6 times. and the answer was 49? then i think im missing something or the instructions should be clearer, because with that it never hits 49amps, could you clarify?

Thanks in advance


#3

By input line 3,
the first click is on device #4, which consumes 14 units.


#4

Instructions should be clearer, i really didn’t understand your reply ( your reply just confirms what i posted )

Intructions:
Each click on a button will toggle the power status - when the power is OFF, a click will turn it ON. The next click will turn it OFF. ( did you mean first click turns it on, second turns it off, then third turns off and stays off the rest of the clicks?, because the way the instructions are is: that is on next click will turn off and so on and in that way, this remains and it never hits 49amps not even with 6 clicks

first click - On first device 10amps - 10 amps total
second click - off first device and on second device 10amps - 10 amps total
third click - on first device 10amps, off second device, on third device 14 amps - 24amps total
fourth click - off first device, on second device 10amps, off third device, on fourth device 14amps - 24amps total
fifth click - on first device 10amps, off second device, on third device 14amps, off fourth device, on fifth device 14amps - 38amps total
sixth click - off first device, on second device 10amps, off third device, on fourth device 14amps, off fifth device, on sixth device 15amps - 39Amps total


#5

In that test case,
according to instruction, the first click is not clicking on the first device.
It is clicking on the 4th device, because the third line reads: 4 3 3 5 4 1 5…
The second click is on the 3rd device.


#6

Hi there,

I’m a bit confused…I pass all the test but when submitting the first validator always fail !!!

I’ve been searching the cause but really don’t find it ??

If someone as the same problem or an idea ?

Thanks
Philippe


#7

Only fails the first validator, or fails all validators?


#8

Hi,
I wrote my code in c++ and passed all test cases.
However, every time I submit the same piece of code, my code fails some validator.
Like, first submission fails validator 5, second submission fail validator 1 and 4.
I do not know how to solve this problem, can someone help me please?
Thank you.


#9

Do you mean, when submitting “the same piece of code” at different times it randomly fails some different validators?

Sounds like magic! :woman_mage:


#10

Yes, that is the case. I am wondering why.


#11

@billysin2017 Interesting! If you send me your code in PM, I’ll have a look at that.


#12

When I submit, i don’t have my results, it’s loading indefinitely. Yet I passed all tests before submitting.
Any idea ?

It’s ok


#13

Please make an example when the fuse is not blown. I don’t understand AT ALL how clicks are made, and what’s the difference between m, n and mx, nx. Should mx, nx be arrays?


#14

There is a “Not blown” example in Testcase 02.

m and n are the counts of elements in the two arrays.

mx is a var name for one of the elements in an array. Because it is created in a loop, there will be m such elements.
You should define your array or list structure before the loop, and then in the loop put the mx value into the structure. After the loop, your structure will be filled up with data.

Same for nx.

If you need further help, tell us what language you are using.
Happy learning.