#CCBCHBA0000016. Đếm cặp dấu của n số (Count Negative, Zero and Positive)
Đếm cặp dấu của n số (Count Negative, Zero and Positive)
Count Negative, Zero and Positive
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Read n integers and count negative, zero and positive values separately; when n=0 all counts are zero.
Input
An integer n (0..100000), followed by n integers in [-1000000,1000000].
Output
The counts of negative, zero, and positive values, in this order, separated by spaces.
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , .
- Subtask 3 (50%): , .
Examples
Example 1
Input
6
-3 0 2 -1 0 7
Output
2 2 2
Explanation
There are two negative, two zero and two positive values.
Example 2
Input
0
Output
0 0 0
Explanation
No loop iteration occurs; all counts remain zero.