#CCBCHMOT0000038. Số nhỏ nhất trước dấu dừng (Minimum Before Sentinel)
Số nhỏ nhất trước dấu dừng (Minimum Before Sentinel)
Minimum Before Sentinel
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Read positive integers up to the first zero. Find the minimum among the preceding values. If zero occurs immediately, print EMPTY. Zero is a sentinel, not a candidate.
Input
A whitespace-separated sequence of positive integers terminated by the first 0.
Output
Print the minimum number, or EMPTY if no number precedes 0.
Subtasks
- Subtask 1 (20%): At most 5 positive values before the sentinel; each is from 1 through 10.
- Subtask 2 (30%): At most 200 positive values before the sentinel; each is from 1 through .
- Subtask 3 (50%): At most positive values before the sentinel; each is from 1 through .
Examples
Example 1
Input
8 3 9 1 0
Output
1
Explanation
The minimum changes 8→3→3→1; zero ends the input.
Example 2
Input
0
Output
EMPTY
Explanation
The first token is the sentinel, so there is no minimum.