結果
問題 | No.928 軽減税率? |
ユーザー |
![]() |
提出日時 | 2020-02-05 22:40:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 1,000 ms |
コード長 | 586 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-23 05:24:28 |
合計ジャッジ時間 | 2,165 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
import sysread = sys.stdin.buffer.readreadline = sys.stdin.buffer.readlinereadlines = sys.stdin.buffer.readlinesP, Q, A = map(int, read().split())def F(a, b, U=10**7):"""count 0 <= n < U such that an + b > 0"""if a == 0:return U if b > 0 else 0if a < 0:return U - F(-a, -b+1, U)low = ((-b) // a) + 1if low < 0:low = 0return max(0, U - low)answer = 0for x in range(1, 101):eat_in = (100 + P) * x // 100take_out = (100 + Q) * x // 100 + Acoef = Q - Panswer += F(coef, take_out - eat_in)print(answer)