結果

問題 No.2681 ゲームセンターの両替
ユーザー 👑 timitimi
提出日時 2024-03-20 21:16:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2024-03-20 21:16:23
合計ジャッジ時間 2,026 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 WA -
testcase_05 AC 36 ms
53,460 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 35 ms
53,460 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 37 ms
53,460 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 36 ms
53,460 KB
testcase_19 AC 37 ms
53,460 KB
testcase_20 AC 37 ms
53,460 KB
testcase_21 AC 37 ms
53,460 KB
testcase_22 AC 37 ms
53,460 KB
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

C,Y=map(int, input().split())
#A=list(map(int, input().split()))
D=[10000,5000,2000,1000,500,100,50,10,5,1]
E=[]
for d in D:
  c=Y//d
  E.append(c)
  Y-=d*c
#print(E) 
c=0
if E[3]>=C:
  print('no exchange')
  exit()
for i in range(len(D)):
  if D[i]>=100:
    c+=(D[i]//100)*E[i]
if c<C:
  print("can't exchange")
  exit()
c=E[3]
d=(C-c-1)//5+1
print(E[3]+5*d)
0