#33735: 解題報告


s11104220@school.saihs.edu.tw (施同學)

學校 : 臺北市立松山高級工農職業學校
編號 : 221254
來源 : [118.165.11.221]
最後登入時間 :
2024-02-04 16:09:17
j605. 1. 程式考試 -- 2023年1月APCS | From: [123.193.213.137] | 發表日期 : 2023-01-28 22:01

我的答案(不是最佳解)

n=int(input())
ts=[]
for i in range(n):
    s=input().split(" ")
    ts.append(s)
maxx=int(ts[0][1])
maxxpos=int(ts[0][0])
for i in range(n):
    if maxx<int(ts[i][1]):
        maxx=int(ts[i][1])
        maxxpos=int(ts[i][0])
wrong=0
for i in range(n):
    if int(ts[i][1])==-1:
        wrong+=1
if maxx-n-wrong*2>0:
    print(maxx-n-wrong*2,maxxpos)
else:
    print(0,maxxpos)
 
ZeroJudge Forum