結果

問題 No.1048 Zero (Advanced)
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-08 22:12:31
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 947 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 71,720 KB
最終ジャッジ日時 2023-09-17 02:58:47
合計ジャッジ時間 3,030 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,604 KB
testcase_01 AC 60 ms
71,336 KB
testcase_02 AC 60 ms
71,176 KB
testcase_03 AC 60 ms
71,720 KB
testcase_04 AC 64 ms
71,352 KB
testcase_05 AC 61 ms
71,460 KB
testcase_06 AC 59 ms
71,488 KB
testcase_07 AC 61 ms
71,340 KB
testcase_08 AC 61 ms
71,376 KB
testcase_09 AC 58 ms
71,508 KB
testcase_10 AC 61 ms
71,476 KB
testcase_11 AC 64 ms
71,516 KB
testcase_12 AC 60 ms
71,256 KB
testcase_13 AC 60 ms
71,256 KB
testcase_14 AC 61 ms
71,380 KB
testcase_15 AC 57 ms
71,512 KB
testcase_16 AC 58 ms
71,432 KB
testcase_17 AC 63 ms
71,412 KB
testcase_18 AC 64 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l, r, m, k = map(int, input().split())

if k == 0:
    print('Yes')
    exit()

il = (l-1)//m
ir = r//m

import math
g = math.gcd(k, m)

if g == 1:
    if ir-il >= 1:
        print('Yes')
    else:
        print('No')
else:
    pl = l%m
    pr = r%m
    p = m//g
    if r-l+1 >= m:
        print('Yes')
    else:
        if pl <= pr:
            if pl <= p <= pr:
                print('Yes')
            else:
                print('No')
        else:
            if 0 <= p <= pr or pl <= p <= m-1:
                print('Yes')
            else:
                print('No')
0