結果

問題 No.1048 Zero (Advanced)
ユーザー neterukunneterukun
提出日時 2020-05-08 22:35:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 71,660 KB
最終ジャッジ日時 2023-09-17 03:12:04
合計ジャッジ時間 2,581 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,140 KB
testcase_01 AC 74 ms
71,336 KB
testcase_02 AC 73 ms
71,224 KB
testcase_03 AC 73 ms
71,356 KB
testcase_04 AC 73 ms
71,292 KB
testcase_05 AC 73 ms
71,376 KB
testcase_06 AC 74 ms
71,204 KB
testcase_07 AC 72 ms
71,296 KB
testcase_08 AC 73 ms
71,460 KB
testcase_09 AC 73 ms
71,544 KB
testcase_10 AC 74 ms
71,348 KB
testcase_11 AC 72 ms
71,432 KB
testcase_12 AC 72 ms
71,296 KB
testcase_13 AC 72 ms
71,356 KB
testcase_14 AC 73 ms
71,460 KB
testcase_15 AC 72 ms
71,660 KB
testcase_16 AC 72 ms
71,656 KB
testcase_17 AC 73 ms
71,516 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if l == 0:
    print("Yes")
    exit()

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

if m == 1:
    print("Yes")
    exit()

if l == r:
    if l * k % m == 0:
        print("Yes")
    else:
        print("No")
    exit()

    
mod_l = l % m
mod_r = r % m

if mod_l >= mod_r:
    print("Yes")
    exit()

width = mod_r - mod_l
sum_w = 1 + width * k

if sum_w >= m:
    print("Yes")
    exit()

l = (mod_l * k) % m
if l + (sum_w - 1) >= m:
    print("Yes")
else:
    print("No")
0