#32699: 為何是NA(10%)??求解??不能用python解嗎??


melodyshih0824 (超萌小辣椒)

學校 : 不指定學校
編號 : 204467
來源 : [218.166.54.147]
最後登入時間 :
2023-06-27 19:20:58
a824. 2.藏寶問題 -- 100學年度桃竹苗區資訊學科能力競賽 | From: [218.166.90.110] | 發表日期 : 2022-10-27 19:59

while True:
    try:
      a,b,c=map(int,input().split())
      total=0
      for i in range(a,c+1):
          if i%a==0 or i%b==0:
              total+=i        
      if total>26:
          s=total-26
          print(chr(s+65-1))
      else:
          print(chr(total+65-1))      
    except:
        break 

 
#32712: Re: 為何是NA(10%)??求解??不能用python解嗎??


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [101.136.203.77]
最後登入時間 :
2024-04-07 15:34:14
a824. 2.藏寶問題 -- 100學年度桃竹苗區資訊學科能力競賽 | From: [101.136.217.109] | 發表日期 : 2022-10-29 14:18

1.
      for i in range(a,c+1):
2.
          s=total-26


1.是從1開始不是從a開始

2.有沒有想過total可能大於52?

 
ZeroJudge Forum