結果

問題 No.795 Restrictions!!!!!!!!!!!!!!
ユーザー Daiki_000
提出日時 2025-01-18 19:34:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 652 bytes
コンパイル時間 518 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2025-01-18 19:34:59
合計ジャッジ時間 2,418 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def check_same_amount(inheritance_heir_A, inheritance_heir_B):
    if sum(inheritance_heir_A) != sum(inheritance_heir_B):
        for i in range(len(inheritance_heir_B)):
            coin_10 = inheritance_heir_B.pop()
            inheritance_heir_A.append(coin_10)
            if sum(inheritance_heir_A) == sum(inheritance_heir_B):
                return "YES"
        return "NO"
    return "YES"


def main():
    N = int(input())
    M = int(input())
    inheritance_heir_A = [100] * N
    inheritance_heir_B = [10] * M
    answer = check_same_amount(inheritance_heir_A, inheritance_heir_B)
    print(answer)


if __name__ == "__main__":
    main()
0