#31121: python AC


forkidlai (forkidlai)

學校 : 不指定學校
編號 : 192336
來源 : [220.130.18.196]
最後登入時間 :
2024-02-06 15:07:01
c875. 107北二2.裝置藝術 -- 107北二區桃竹苗資訊學科能力複賽 | From: [220.130.18.196] | 發表日期 : 2022-07-13 10:35

最後一筆測資string太大,用input().split()會memory error

改用string手工處理切分

n,h,g = map(int,input().split())
s = input()
clist = []
tmp = ''
for c in s:
    if c == ' ':
        clist.append(int(tmp)//h)
        tmp = ''
    else:
        tmp += c
if tmp:
    clist.append(int(tmp)//h)

# clist = [int(x)//h for x in input().split()] #每塔罐數, 最後一筆測資用split會 memory error
 
ZeroJudge Forum