a175. pA Altitude Sickness
Tags :
Accepted rate : 2人/3人 ( 67% ) [非即時]
評分方式:
Tolerant

最近更新 : 2020-12-24 11:00

Content

原題連結

Froggy’s class plans a hiking for their graduation trip. They decide to stay in the Green Mountains for 2 days. Froggy has a map with n-by-m grids on it. Each grid indicates 1 acre with its height noted. However, some of Froggy’s classmates have altitude sickness. Given each classmate’s maximum altitude that they can endure, please calculate how many acres they can stay safely for the trip. 

Input

The first line consists of 3 space-separated integers n, m and q. n and m indicate the size of the map, and q is the number of queries. The following n lines contain m space-separated integers each, the j th element in the i th line aij is the altitude of the grid cell on the intersection of the i th row and the j th column. For next q lines, each line is a query with one integer h indicating the maximum height that a Froggy’s classmate’s maximum altitude that they can endure.

Output

For each query, please output the area (in acres) that the classmate can stay safely.

Technical Specification

• 1 ≤ n × m ≤ 105

• 1 ≤ q ≤ 105

• 1 ≤ aij ≤ 1018

• 1 ≤ h ≤ 1018

Sample Input #1
3 5 4
4 2 5 1 8
1 4 2 8 9
9 9 2 3 5
1
3
6
8
Sample Output #1
2
6
10
12
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (12%): 3.0s , <10M
公開 測資點#1 (12%): 3.0s , <10M
公開 測資點#2 (12%): 3.0s , <10M
公開 測資點#3 (12%): 3.0s , <10M
公開 測資點#4 (13%): 3.0s , <10M
公開 測資點#5 (13%): 3.0s , <10M
公開 測資點#6 (13%): 3.0s , <10M
公開 測資點#7 (13%): 3.0s , <10M
Hint :

 Note: acre is a unit of area.

Tags:
出處:
CPTC2020 [管理者: s710426(?0_o)//) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」