結果

問題 No.1048 Zero (Advanced)
ユーザー yosakayosaka
提出日時 2020-05-08 22:40:47
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 955 bytes
コンパイル時間 2,922 ms
コンパイル使用メモリ 69,204 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-17 03:14:44
合計ジャッジ時間 3,867 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 54) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'streams' [UnusedImport]
/home/judge/data/code/Main.nim(1, 54) Warning: imported and not used: 'future' [UnusedImport]
/home/judge/data/code/Main.nim(1, 76) Warning: imported and not used: 'hashes' [UnusedImport]
/home/judge/data/code/Main.nim(1, 37) Warning: imported and not used: 'algorithm' [UnusedImport]
/home/judge/data/code/Main.nim(1, 68) Warning: imported and not used: 'tables' [UnusedImport]

ソースコード

diff #

import streams, sequtils, strutils, algorithm, math, future, sets, tables, hashes
proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0)
proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y
proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y

var
    T = stdin.readLine.split.map(parseInt)
    L = T[0]
    R = T[1]
    M = T[2]
    K = T[3]
if K == 0 or M == 1:
    echo "Yes"
elif K * R < M:
    if L == 0:
        echo "Yes"
    else:
        echo "No"
elif K * R == M:
    echo "Yes"
elif K * R > M:
    if (R - L) * K >= M:
        echo "Yes"
    else:
        echo "No"
elif L <= M and M <= R:
    echo "Yes"
elif (L div M) < (R div M):
    echo "Yes"
elif K mod 2 == 0:
    if ((R + max(L, R-1)) - (L + min(L+1, R))) <= M:
        echo "Yes"
    else:
        echo "No"
elif K mod 2 == 1:
    echo "No"
else:
    echo "No"
# elif (L div M) == (R div M):
#     var 
#         minmod = L mod M
#         maxmod = R mod M
    
0