Skip to main content

Practice · 3 of 5

Number Classes

CHALLENGE
Difficulty: intermediate+25 XP

**Description:** For each query value x, classify: perfect-square if x is a perfect square (0, 1, 4, 9, ...), even if even, odd otherwise. Perfect-square wins over parity. **Input:** Line 1: q (1 <= q <= 100000). Next q lines: x (0 <= x <= 10^9). **Output:** q lines: the classification. **Example:** 3 / 16 / 6 / 7 -> perfect-square / even / odd.

Back to lesson: Practice: Mixed Mock Problems