結果
| 問題 | No.928 軽減税率? |
| コンテスト | |
| ユーザー |
ptotq
|
| 提出日時 | 2019-11-22 23:47:12 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 19 ms / 1,000 ms |
| + 49µs | |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-10-28 13:58:26 |
| 合計ジャッジ時間 | 3,140 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
P, Q, A = map(int, input().split())
P += 100
Q += 100
def solve(x):
return (P*x / 100) - (Q*x / 100) < A-1
if P == Q:
print(10**9 if A > 0 else 0)
exit()
if P > Q:
ok, ng = 0, 10**9+1
while ng - ok > 1:
mid = (ok+ng)//2
if solve(mid):
ok = mid
else:
ng = mid
for x in range(ok+1, 10**9+1):
d = (P*x // 100) - (Q*x // 100)
if d < A:
ok += 1
elif d >= A+1:
break
print(ok)
else:
ans = 10**9
for x in range(1, 10**9):
d = (P*x // 100) - (Q*x // 100)
if d >= A:
ans -= 1
elif d < A-1:
break
print(ans)
ptotq