| { |
| "task": { |
| "id": "case_101", |
| "name": "check_square", |
| "summary": "Check if each element is a square of an integer.", |
| "examples": [ |
| { |
| "input": [ |
| "BOS", |
| 6, |
| 19, |
| 28, |
| 14, |
| 10, |
| 7, |
| 28, |
| 20, |
| 6 |
| ], |
| "output": [ |
| "BOS", |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0 |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 25, |
| 18, |
| 22, |
| 10, |
| 10, |
| 23, |
| 20, |
| 3, |
| 7 |
| ], |
| "output": [ |
| "BOS", |
| 1, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0, |
| 0 |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 24, |
| 16, |
| 26, |
| 26, |
| 9, |
| 27, |
| 27, |
| 15, |
| 14 |
| ], |
| "output": [ |
| "BOS", |
| 0, |
| 1, |
| 0, |
| 0, |
| 1, |
| 0, |
| 0, |
| 0, |
| 0 |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 1, |
| 27, |
| 20, |
| 0, |
| 11, |
| 25, |
| 21, |
| 28, |
| 11 |
| ], |
| "output": [ |
| "BOS", |
| 1, |
| 0, |
| 0, |
| 1, |
| 0, |
| 1, |
| 0, |
| 0, |
| 0 |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 23, |
| 2, |
| 21, |
| 20, |
| 1, |
| 23, |
| 11, |
| 29, |
| 5 |
| ], |
| "output": [ |
| "BOS", |
| 0, |
| 0, |
| 0, |
| 0, |
| 1, |
| 0, |
| 0, |
| 0, |
| 0 |
| ] |
| } |
| ], |
| "is_categorical": true |
| }, |
| "program": "check_square = rasp.Map(lambda x: 1 if x ** 0.5 == int(x ** 0.5) else 0, rasp.tokens).named(\"check_square\")\nreturn check_square", |
| "components": [ |
| { |
| "id": "L0_MLP", |
| "hook": "blocks.0.mlp.hook_post", |
| "role": { |
| "tag": "INDICATOR", |
| "note": "Evaluates each element independently and checks if it is a perfect square." |
| }, |
| "rasp_vars": [ |
| "check_square" |
| ], |
| "labels": [ |
| "map_1" |
| ] |
| } |
| ] |
| } |
|
|