102221: [AtCoder]ABC222 B - Failing Grade
Description
Score : $200$ points
Problem Statement
$N$ students took an exam. The students are labeled as Student $1$, Student $2$, $\dots$, Student $N$, and Student $i$ scored $a_i$ points.
A student who scored less than $P$ points are considered to have failed the exam and cannot earn the credit. Find the number of students who failed the exam.
Constraints
- $1 \leq N \leq 10^5$
- $1 \leq P \leq 100$
- $0 \leq a_i \leq 100$ $(1 \leq i \leq N)$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$N$ $P$ $a_1$ $a_2$ $\dots$ $a_N$
Output
Print the number of students who failed the exam.
Sample Input 1
4 50 80 60 40 0
Sample Output 1
2
Students $1$ and $2$, who scored $80$ and $60$ points, respectively, succeeded in scoring at least $50$ points to earn the credit.
On the other hand, Students $3$ and $4$, who scored $40$ and $0$ points, respectively, fell below $50$ points and failed the exam. Thus, the answer is $2$.
Sample Input 2
3 90 89 89 89
Sample Output 2
3
Sample Input 3
2 22 6 37
Sample Output 3
1
Input
题意翻译
给定一个 $n$ 个元素的序列 $a$,求有多少个元素满足 $a_i < p$,$1\le i\le n$。 $1\le n\le 10^5$,$1\le p\le 100$,$0\le a_i\le 100$。Output
分数:200分
问题描述
N个学生参加了一次考试。学生们被标记为学生1,学生2,……,学生N,学生i的分数为a_i。
分数低于P分的学生被认为考试失败,无法获得学分。找出考试失败的学生人数。
限制条件
- $1 \leq N \leq 10^5$
- $1 \leq P \leq 100$
- $0 \leq a_i \leq 100$ $(1 \leq i \leq N)$
- 输入中的所有值都是整数。
输入
从标准输入按以下格式获取输入:
$N$ $P$ $a_1$ $a_2$ $\dots$ $a_N$
输出
输出考试失败的学生人数。
样例输入1
4 50 80 60 40 0
样例输出1
2
学生1和2,分别获得80和60分,成功获得了至少50分的学分。
另一方面,学生3和4,分别获得40和0分,低于50分,考试失败。因此,答案是2。
样例输入2
3 90 89 89 89
样例输出2
3
样例输入3
2 22 6 37
样例输出3
1