結果

問題 No.842 初詣
ユーザー takakin
提出日時 2020-05-03 20:34:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-22 23:16:56
合計ジャッジ時間 2,065 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
*A,g=map(int, input().split())
C=[500,100,50,10,5,1]
for a in range(A[0]+1):
  for b in range(A[1]+1):
    for c in range(A[2]+1):
      for d in range(A[3]+1):
        for e in range(A[4]+1):
          for f in range(A[5]+1):
            if 500*a+100*b+50*c+10*d+5*e+f==g:
              print("YES")
              break
          else:
            continue
          break
        else:
          continue
        break
      else:
        continue
      break
    else:
      continue
    break
  else:
    continue
  break
else:
  print("NO")
0