結果

問題 No.842 初詣
ユーザー first_vilfirst_vil
提出日時 2020-08-02 10:39:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 8,144 KB
最終ジャッジ日時 2023-09-25 10:43:39
合計ジャッジ時間 1,826 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,028 KB
testcase_01 AC 15 ms
8,140 KB
testcase_02 AC 16 ms
7,856 KB
testcase_03 AC 24 ms
8,064 KB
testcase_04 AC 20 ms
7,980 KB
testcase_05 AC 43 ms
8,140 KB
testcase_06 AC 16 ms
7,896 KB
testcase_07 AC 41 ms
7,856 KB
testcase_08 AC 17 ms
7,844 KB
testcase_09 AC 23 ms
8,108 KB
testcase_10 AC 61 ms
8,144 KB
testcase_11 AC 15 ms
7,852 KB
testcase_12 AC 16 ms
8,092 KB
testcase_13 AC 20 ms
8,128 KB
testcase_14 AC 17 ms
7,784 KB
testcase_15 AC 16 ms
7,796 KB
testcase_16 AC 19 ms
7,896 KB
testcase_17 AC 16 ms
8,076 KB
testcase_18 AC 16 ms
8,088 KB
testcase_19 AC 28 ms
8,116 KB
testcase_20 AC 40 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a=list(map(int,input().split()))
b=[500,100,50,10,5,1]
def dfs(i,cur):
    if i==6:
        if cur==a[6]:
            print('YES')
            exit(0)
    else:
        for j in range(a[i]+1):
            dfs(i+1,cur+b[i]*j)
dfs(0,0)
print('NO')
0