結果

問題 No.842 初詣
ユーザー hedwig100hedwig100
提出日時 2020-04-24 11:15:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 468 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 49,696 KB
最終ジャッジ日時 2024-04-23 02:26:30
合計ジャッジ時間 11,105 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 458 ms
44,576 KB
testcase_01 AC 446 ms
44,196 KB
testcase_02 AC 453 ms
44,204 KB
testcase_03 AC 447 ms
44,188 KB
testcase_04 AC 459 ms
44,580 KB
testcase_05 AC 454 ms
44,968 KB
testcase_06 AC 443 ms
44,196 KB
testcase_07 AC 449 ms
44,188 KB
testcase_08 AC 450 ms
44,448 KB
testcase_09 AC 450 ms
44,324 KB
testcase_10 AC 451 ms
49,696 KB
testcase_11 AC 458 ms
44,428 KB
testcase_12 AC 450 ms
44,192 KB
testcase_13 AC 452 ms
44,324 KB
testcase_14 AC 445 ms
44,456 KB
testcase_15 AC 452 ms
44,320 KB
testcase_16 AC 458 ms
44,196 KB
testcase_17 AC 464 ms
44,704 KB
testcase_18 AC 445 ms
44,964 KB
testcase_19 AC 452 ms
44,192 KB
testcase_20 AC 468 ms
44,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
def main():
    *C,g = map(int,input().split())
    Tot = np.array([0],dtype = np.int64)
    V = [500,100,50,10,5,1]
    for i in range(6):
        Tot = np.add.outer(Tot,np.arange(C[i] + 1,dtype = np.int64) * V[i]).flatten()
    if np.any(Tot == g):
        print('YES')
    else:
        print('NO')
if __name__ =='__main__':
    main()  
0