結果

問題 No.2681 ゲームセンターの両替
ユーザー 👑 timitimi
提出日時 2024-03-20 21:18:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2024-04-15 10:11:51
合計ジャッジ時間 2,440 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
52,068 KB
testcase_01 AC 49 ms
51,964 KB
testcase_02 AC 45 ms
53,296 KB
testcase_03 AC 45 ms
52,824 KB
testcase_04 AC 45 ms
52,428 KB
testcase_05 AC 45 ms
52,756 KB
testcase_06 AC 45 ms
52,336 KB
testcase_07 AC 44 ms
52,296 KB
testcase_08 AC 46 ms
52,076 KB
testcase_09 AC 45 ms
52,596 KB
testcase_10 AC 46 ms
52,800 KB
testcase_11 AC 45 ms
52,824 KB
testcase_12 AC 44 ms
52,664 KB
testcase_13 AC 44 ms
52,772 KB
testcase_14 AC 46 ms
52,700 KB
testcase_15 AC 45 ms
52,268 KB
testcase_16 AC 45 ms
51,948 KB
testcase_17 AC 47 ms
52,736 KB
testcase_18 AC 45 ms
52,424 KB
testcase_19 AC 45 ms
51,940 KB
testcase_20 AC 49 ms
52,056 KB
testcase_21 AC 48 ms
52,668 KB
testcase_22 AC 49 ms
52,268 KB
testcase_23 AC 48 ms
52,528 KB
testcase_24 AC 46 ms
52,872 KB
testcase_25 AC 45 ms
53,760 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[5]>=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[5]
d=(C-c-1)//5+1
print(E[5]+5*d)
0