結果

問題 No.2259 Gas Station
ユーザー 👑 timitimi
提出日時 2023-04-15 14:15:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 54,176 KB
最終ジャッジ日時 2024-04-19 08:40:40
合計ジャッジ時間 1,979 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,344 KB
testcase_01 AC 36 ms
51,900 KB
testcase_02 AC 35 ms
51,900 KB
testcase_03 AC 35 ms
51,868 KB
testcase_04 AC 36 ms
54,176 KB
testcase_05 AC 35 ms
53,008 KB
testcase_06 AC 36 ms
53,232 KB
testcase_07 AC 36 ms
53,108 KB
testcase_08 AC 36 ms
52,672 KB
testcase_09 AC 36 ms
52,580 KB
testcase_10 AC 35 ms
53,164 KB
testcase_11 AC 36 ms
53,184 KB
testcase_12 AC 35 ms
52,188 KB
testcase_13 AC 36 ms
52,808 KB
testcase_14 AC 37 ms
53,428 KB
testcase_15 AC 35 ms
53,060 KB
testcase_16 AC 36 ms
52,120 KB
testcase_17 AC 36 ms
52,556 KB
testcase_18 AC 35 ms
52,840 KB
testcase_19 AC 36 ms
52,504 KB
testcase_20 AC 36 ms
52,156 KB
testcase_21 AC 36 ms
52,216 KB
testcase_22 AC 36 ms
53,456 KB
testcase_23 AC 36 ms
53,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,R,C=map(int,input().split())
D={}
ans=1000
for x in range(L,R+1):
  d=x*C%1000
  if d==0:
    print(0)
    exit()
  d=1000-d 
  if d not in D:
    D[d]=1
    ans=min(ans,d)
  else:
    break
print(ans)
0