QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23975. Building 5

Statistics

問題文

JOI 国には N 棟のビルがある.i 番目 (1 ≦ i ≦ N) のビルの高さは Hi メートルである.

これらのビルのうち,高さが X メートル以上のものは何棟あるかを求めよ.

制約

  • 1 ≦ N ≦ 100.
  • 1 ≦ X ≦ 1 000.
  • 1 ≦ Hi≦ 1 000 (1 ≦ i ≦ N).
  • 入力される値はすべて整数である.

入力

入力は以下の形式で与えられる.
N X
H1 H2 … HN

出力

高さが X メートル以上であるビルの数を,単位 (棟) を省いて出力せよ.

答え以外は何も出力しないこと.(入力を促す文章なども出力しないこと.)

解答形式については,練習問題やその解答例を参考にしても良い.


入力例 1

3   20
18   25   20

出力例 1

2

JOI 国には 3 棟のビルがあり,それぞれの高さは 18 メートル,25 メートル,20 メートルである.

これらのうち,高さが 20 メートル以上であるビルは 2 棟である.したがって 2 を出力する.


入力例 2

4   10
3   9   1   3

出力例 2

0

JOI 国には 4 棟のビルがあり,それぞれの高さは 3 メートル,9 メートル,1 メートル,3 メートルである.

これらのうち,高さが 10 メートル以上であるビルは存在しない.したがって 0 を出力する.


入力例 3

1   100
100

出力例 3

1

入力例 4

5   634
829   679   632   601   600

出力例 4

2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.