Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
25
Task/Population-count/ABC/population-count.abc
Normal file
25
Task/Population-count/ABC/population-count.abc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
HOW TO RETURN popcount n:
|
||||
IF n=0: RETURN 0
|
||||
RETURN (n mod 2) + popcount (floor (n/2))
|
||||
|
||||
HOW TO REPORT evil n:
|
||||
REPORT (popcount n) mod 2 = 0
|
||||
|
||||
HOW TO REPORT odious n:
|
||||
REPORT (popcount n) mod 2 = 1
|
||||
|
||||
FOR i IN {0..29}: WRITE popcount (3 ** i)
|
||||
WRITE /
|
||||
|
||||
PUT {} IN evilnums
|
||||
PUT {} IN odiousnums
|
||||
|
||||
FOR n IN {0..59}:
|
||||
SELECT:
|
||||
evil n: INSERT n IN evilnums
|
||||
odious n: INSERT n IN odiousnums
|
||||
|
||||
FOR i IN {1..30}: WRITE evilnums item i
|
||||
WRITE /
|
||||
FOR i IN {1..30}: WRITE odiousnums item i
|
||||
WRITE /
|
||||
Loading…
Add table
Add a link
Reference in a new issue