結果

問題 No.928 軽減税率?
ユーザー titiatitia
提出日時 2019-11-22 21:56:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,000 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-19 11:15:13
合計ジャッジ時間 33,828 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 823 ms
10,880 KB
testcase_01 AC 809 ms
10,880 KB
testcase_02 AC 26 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 AC 885 ms
10,880 KB
testcase_05 AC 862 ms
10,880 KB
testcase_06 TLE -
testcase_07 AC 829 ms
10,880 KB
testcase_08 AC 828 ms
11,008 KB
testcase_09 AC 868 ms
10,880 KB
testcase_10 AC 875 ms
10,880 KB
testcase_11 AC 871 ms
10,880 KB
testcase_12 TLE -
testcase_13 AC 882 ms
10,752 KB
testcase_14 AC 927 ms
10,880 KB
testcase_15 AC 959 ms
11,008 KB
testcase_16 AC 873 ms
10,880 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 AC 789 ms
11,008 KB
testcase_23 AC 26 ms
10,880 KB
testcase_24 AC 25 ms
11,008 KB
testcase_25 AC 842 ms
10,880 KB
testcase_26 AC 800 ms
10,880 KB
testcase_27 AC 815 ms
10,880 KB
testcase_28 AC 807 ms
10,880 KB
testcase_29 AC 786 ms
10,880 KB
testcase_30 AC 788 ms
10,880 KB
testcase_31 AC 802 ms
10,880 KB
testcase_32 AC 829 ms
11,008 KB
testcase_33 AC 771 ms
10,880 KB
testcase_34 AC 809 ms
10,880 KB
testcase_35 AC 881 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P,Q,A=map(int,input().split())

if P<=Q:
    if A>0:
        print(10**9)
    else:
        NG=0
        OK=10**9

        while OK-NG>1:
            mid=(OK+NG)//2

            if int((1+P/100)*mid)<int((1+Q/100)*mid):
                OK=mid
            else:
                NG=mid

        SA=0
        for i in range(max(1,mid-10**6),min(mid+10**6,10**9+1)):
            if i<=NG and int((1+P/100)*i)<int((1+Q/100)*i):
                SA+=1
            elif i>=OK and int((1+P/100)*i)>=int((1+Q/100)*i):
                SA-=1
            
        print(10**9-NG+SA)

else:
    OK=0
    NG=10**9+1

    while NG-OK>1:
        mid=(OK+NG)//2

        if int((1+P/100)*mid)<int((1+Q/100)*mid)+A:
            OK=mid
        else:
            NG=mid

    SA=0
    for i in range(max(1,mid-10**6),min(mid+10**6,10**9+1)):
        if i<=OK and int((1+P/100)*i)>=int((1+Q/100)*i)+A:
            SA-=1
        elif i>=NG and int((1+P/100)*i)<int((1+Q/100)*i)+A:
            SA+=1
        
    print(OK+SA)
0