Submission details
Task:Lukujono
Sender:nikke5
Submission time:2025-11-09 23:14:22 +0200
Language:text
Status:READY
Result:0
Feedback
groupverdictscore
#1ACCEPTED0
Test results
testverdicttimescore
#1ACCEPTED0.00 s0details

Code

CLEAR Y # loop times

INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y
INCREASE Y

PRINT X #print 

REPEAT Y TIMES
(

	CLEAR A # will be used as a temp variable for decrease

	CLEAR B # will be x-1

	REPEAT X TIMES
	(
		CLEAR B
		REPEAT A TIMES
		(
			INCREASE B
		)
		INCREASE A
	)
	CLEAR A # temp decrease
	CLEAR C # will be X-1-1
	CLEAR D
	INCREASE D
	INCREASE D # amount of decreases for C (2)
	CLEAR E # temp variable to store the first x-1
	REPEAT X TIMES
	(
		INCREASE E
	)

	REPEAT D TIMES # repeat 2 times
	(
		CLEAR A # clearing temp variable
		REPEAT E TIMES
		(
			CLEAR C
			REPEAT A TIMES
			(
				INCREASE C
			)
			INCREASE A 
		)
		CLEAR E # clearing E 
		REPEAT C TIMES
		(
			INCREASE E # making E x-1
		)
	)

	# now B is x-1 and C is x-2

	# lets decrease B C times:

	CLEAR A # temp decrease
	CLEAR D

	REPEAT C TIMES
	(
		INCREASE D # amount of decreases for B
	)
	CLEAR E # temp variable to store decreased value
	REPEAT B TIMES
	(
		INCREASE E
	)

	REPEAT D TIMES # repeat D times
	(
		CLEAR A # clearing temp variable
		REPEAT E TIMES
		(
			CLEAR B
			REPEAT A TIMES
			(
				INCREASE B
			)
			INCREASE A 
		)
		CLEAR E # clearing E 
		REPEAT B TIMES
		(
			INCREASE E # making E x-1
		)
	)


	# now B is 0 if X = 1 and in other cases its 1

	REPEAT B TIMES
	(



		# now lets put the current number through alogrithm
		# since it was not 1

		# PARILLINEN CHECK:
		CLEAR A # A = X before modification


		# Sitten käytetään jakofunktiota A:han ja tallennetaan vastaus E:hen
        CLEAR A # temp variable
        CLEAR B # temp variable
        CLEAR C 
        REPEAT X TIMES
        (
            INCREASE B 
            REPEAT A TIMES
            (
                CLEAR A
                CLEAR B 

                
            )

            REPEAT B TIMES
            (
                INCREASE A

                INCREASE C 
            )
        )


		# Nyt kun käsittelynumero on jaettu ja laitettu variableen E 
		# voidaan tehdä uusi variable joka on E - 1:

		CLEAR A # will be used as a temp variable for decrease

		CLEAR B # will be x-1

		REPEAT E TIMES
		(
			CLEAR B
			REPEAT A TIMES
			(
				INCREASE B
			)
			INCREASE A
		)

		# now B is E-1

		# now lets decrease B and E from X and store vastaus in V 

		CLEAR V # will be the vastaus
		REPEAT X TIMES
		(
			INCREASE V # Increase V to X in case it will be reduced by 0
			# and the loop wont add anything to V
		)

		CLEAR D # will be amount of decreases

		REPEAT B TIMES
		(
			INCREASE D # amount of decreases for V
		)
		CLEAR T # temp variable to store decreased value
		REPEAT X TIMES
		(
			INCREASE T # T should be the starting amount
		)

		REPEAT D TIMES # amount of decreases
		(
			CLEAR A # clearing temp variable
			REPEAT T TIMES
			(
				CLEAR V
				REPEAT A TIMES
				(
					INCREASE V
				)
				INCREASE A 
			)
			CLEAR T # clearing T
			REPEAT V TIMES
			(
				INCREASE T # making T V-1
			)
		)

		
		# now we have done X - B and stored to V. Lets do V - E to complete.
		
		CLEAR D # will be amount of decreases

		REPEAT E TIMES
		(
			INCREASE D # amount of decreases for V
		)
		CLEAR T # temp variable to store decreased value
		REPEAT V TIMES
		(
			INCREASE T # T should be the starting amount
		)

		

		REPEAT D TIMES # amount of decreases
		(
			CLEAR A # clearing temp variable
			REPEAT T TIMES
			(
				CLEAR V
				REPEAT A TIMES
				(
					INCREASE V
				)
				INCREASE A 
			)
			CLEAR T # clearing T
			REPEAT V TIMES
			(
				INCREASE T # making T V-1
			)
		)

		

		# now V is 1 if its parillinen and 0 if its pariton!

		REPEAT V TIMES # PARILLISEN LUVUN KÄSITTELY
		(
			# this happens only if X is parillinen

			# tehdään jakolasku X / 2

			# JAKOLASKU ALKAA
			# Sitten käytetään jakofunktiota A:han ja tallennetaan vastaus C:hen
            CLEAR A # temp variable
            CLEAR B # temp variable
            CLEAR C 
            REPEAT X TIMES
            (
                INCREASE B 
                REPEAT A TIMES
                (
                    CLEAR A
                    CLEAR B 

                    
                )

                REPEAT B TIMES
                (
                    INCREASE A

                    INCREASE C 
                )
            )
			# JAKOLASKU LOPPUU ja lasku tallennettu E:hen

			CLEAR M 
			REPEAT C TIMES 
			(
				INCREASE M # Tallennetaan X / 2 M:ään
			)
		)

		# Now lets check if the luku X is pariton:
		# PARITTOMAN LUVUN CHECK

		# Parittoman luvun check on täysin sama kuin parillisen 
		# mutta tehdään vain sama funktio X+1 :dellä

		# Eli katsotaan onko X+1 parillinen :D 

		# PARILLINEN CHECK:
		CLEAR A # A = X before modification
		CLEAR B # temp variable

		CLEAR P # This will be X+1 due to this being pariton check

		REPEAT X TIMES 
		(
			INCREASE P
		)

		INCREASE P # Nyt P on X+1

		# Sitten käytetään jakofunktiota A:han ja tallennetaan vastaus E:hen

        CLEAR A # temp
        CLEAR B # temp
		CLEAR E

        REPEAT P TIMES
        (
            INCREASE B 
            REPEAT A TIMES
            (
                CLEAR A
                CLEAR B 
            )

            REPEAT B TIMES
            (
                INCREASE A

                INCREASE E
            )
        )


		# Nyt kun käsittelynumero on jaettu ja laitettu variableen E 
		# voidaan tehdä uusi variable joka on E - 1:

		CLEAR A # will be used as a temp variable for decrease

		CLEAR B # will be x-1

		REPEAT E TIMES
		(
			CLEAR B
			REPEAT A TIMES
			(
				INCREASE B
			)
			INCREASE A
		)

		# now B is E-1

		# now lets decrease B and E from X and store vastaus in V 

		CLEAR V # will be the vastaus
		REPEAT P TIMES
		(
			INCREASE V # Increase V to X in case it will be reduced by 0
			# and the loop wont add anything to V
		)

		CLEAR D # will be amount of decreases

		REPEAT B TIMES
		(
			INCREASE D # amount of decreases for V
		)
		CLEAR T # temp variable to store decreased value
		REPEAT P TIMES
		(
			INCREASE T # T should be the starting amount
		)

		REPEAT D TIMES # amount of decreases
		(
			CLEAR A # clearing temp variable
			REPEAT T TIMES
			(
				CLEAR V
				REPEAT A TIMES
				(
					INCREASE V
				)
				INCREASE A 
			)
			CLEAR T # clearing T
			REPEAT V TIMES
			(
				INCREASE T # making T V-1
			)
		)

		# now we have done X - B and stored to V. Lets do V - E to complete.
		
		CLEAR D # will be amount of decreases

		REPEAT E TIMES
		(
			INCREASE D # amount of decreases for V
		)
		CLEAR T # temp variable to store decreased value
		REPEAT V TIMES
		(
			INCREASE T # T should be the starting amount
		)

		REPEAT D TIMES # amount of decreases
		(
			CLEAR A # clearing temp variable
			REPEAT T TIMES
			(
				CLEAR V
				REPEAT A TIMES
				(
					INCREASE V
				)
				INCREASE A 
			)
			CLEAR T # clearing T
			REPEAT V TIMES
			(
				INCREASE T # making T V-1
			)
		)

		

		# now V is 1 if X is pariton and 0 if X is parillinen!

		REPEAT V TIMES # PARITTOMAN LUVUN KÄSITTELY
		(


            # eli kerro kolmella ja lisää yksi
            CLEAR T # temp to be X 
            REPEAT X TIMES 
            (
                INCREASE T # set T to X
            )

            CLEAR M # clearataan M jotta se voidaan asettaa 
            CLEAR K # temp variable to be 3
            INCREASE K 
            INCREASE K 
            INCREASE K # set K to 3
            REPEAT T TIMES 
            (
                REPEAT K TIMES 
                (
                    INCREASE M
                )
            )

            INCREASE M # last increase 

            CLEAR X 
            REPEAT M TIMES 
            (
                INCREASE X 
            )
            PRINT X #print 


            # TEHDÄÄN PARILLISEN LUVUN KÄSITTELY HETI PERÄÄN

            # this happens only if X is parillinen

            # tehdään jakolasku X / 2

            # JAKOLASKU ALKAA
            # Sitten käytetään jakofunktiota A:han ja tallennetaan vastaus C:hen
            CLEAR A # temp variable
            CLEAR B # temp variable
            CLEAR C 
            REPEAT X TIMES
            (
                INCREASE B 
                REPEAT A TIMES
                (
                    CLEAR A
                    CLEAR B 

                    
                )

                REPEAT B TIMES
                (
                    INCREASE A

                    INCREASE C 
                )
            )
            # JAKOLASKU LOPPUU ja lasku tallennettu E:hen

            CLEAR M 
            REPEAT C TIMES 
            (
                INCREASE M # Tallennetaan X / 2 M:ään
            )



            
		)
		
		# viimeisenä asetetaan X M:ään
        CLEAR X
		REPEAT M TIMES 
		(
			INCREASE X 
		)
		PRINT X #print 
	)



)

Test details

Test 1 (public)

Verdict: ACCEPTED

input
(empty)

correct output
(empty)

user output

CLEAR Y # loop times

INCREASE Y
INCREASE Y
...

Feedback: 8 tests processed (invalid output)