Submission details
Task:Lukujono
Sender:rendes
Submission time:2025-11-04 11:58:34 +0200
Language:text
Status:READY
Result:0
Feedback
groupverdictscore
#1ACCEPTED0
Test results
testverdicttimescore
#1ACCEPTED0.00 s0details

Code

#1000

PRINT X

INCREASE M
INCREASE M

# Research shows that the max step for collatz 1-1000 is 178 :)

REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( REPEAT M TIMES ( INCREASE P ) ) ) ) ) ) ) )


INCREASE S
REPEAT P TIMES (
 REPEAT S TIMES (

 # Is even? and halve anyways
 CLEAR G
 CLEAR B
 CLEAR A
 REPEAT X TIMES (
   INCREASE B
   REPEAT A TIMES (
    CLEAR A
    CLEAR B
   )
   REPEAT B TIMES (
    INCREASE A
    INCREASE G
   )
  )
 CLEAR I
 INCREASE I
 # Was uneven???
 REPEAT B TIMES (
  CLEAR I
  REPEAT X TIMES ( REPEAT M TIMES ( INCREASE X ) )
  INCREASE X
 )

 REPEAT I TIMES (
  # 1 always comes after 2 so check if we should continue
  CLEAR S
  CLEAR X
  REPEAT G TIMES ( INCREASE X INCREASE S REPEAT I TIMES ( CLEAR S CLEAR I ) ) # Set S=G-1 and X=S
  REPEAT S TIMES ( CLEAR S INCREASE S ) # continue or not if X was 1
  REPEAT S TIMES ( PRINT G )
 )

 REPEAT B TIMES ( PRINT X ) # was x*3+1 so print

 )
)

Test details

Test 1 (public)

Verdict: ACCEPTED

input
(empty)

correct output
(empty)

user output
#1000

PRINT X

INCREASE M
...

Feedback: 0 tests processed (invalid output)