結果

問題 No.550 夏休みの思い出(1)
ユーザー titiatitia
提出日時 2024-03-12 01:50:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,045 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 89,364 KB
最終ジャッジ日時 2024-03-12 01:50:38
合計ジャッジ時間 7,391 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 割り切れる割り算、上の桁から。
def poly_div(X,Y):
    ANS=[0]*(len(X)-len(Y)+1)

    for i in range(len(X)-len(Y)+1):
        if X[i]%Y[0]!=0:
            return False
        
        ANS[i]=X[i]//Y[0]
        for j in range(len(Y)):
            X[j+i]-=ANS[i]*Y[j]

    return ANS

# 掛け算
def poly_mul(X,Y):
    ANS=[0]*(len(X)+len(Y)-1)

    for i in range(len(X)):
        for j in range(len(Y)):
            ANS[i+j]+=X[i]*Y[j]

    return ANS


A,B,C=map(int,input().split())


for i in range(-10**7,10**7):
    ANS=poly_div([1,A,B,C],[1,-i])

    if ANS!=False:
        a,b,c=ANS

        if b*b-4*c<0:
            continue

        k=(-b+(b*b-4*c)**(1/2))/2
        l=(-b-(b*b-4*c)**(1/2))/2

        if abs(k-round(k))<0.00000000000001 and abs(l-round(l))<0.00000000000001:
            L=[i,round(k),round(l)]
            L.sort()

            XX=poly_mul(poly_mul([1,-i],[1,-round(k)]),[1,-round(l)])

            if XX[1:]==[A,B,C]:
                print(*L)
                exit()
                
            
0