ABC解説 Edit

【pythonでABC208を解説】A - Rolling Dice

問題概要

問題ページ

A - Rolling Dice
A - Rolling Dice

問題ページへ移動する

問題文

\(1,2,\ldots,6\) の出目がある \(6\) 面サイコロを \(A\) 回振ったとき、出た目の合計が \(B\) になることはありますか?

制約

  • \(1 \leq A \leq 100\)
  • \(1 \leq B \leq 1000\)
  • \(A, B\) は整数である。

問題の考察

ACコード

import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    print("Yes" if a <= b <= a * 6 else "No")


if __name__ == '__main__':
    solve()

-ABC解説, Edit
-