結果

問題 No.955 ax^2+bx+c=0
ユーザー NyaanNyaan
提出日時 2021-01-03 23:47:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 729 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2024-10-13 17:40:40
合計ジャッジ時間 8,858 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 70 WA * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from functools import lru_cache
from bisect import bisect_left as lb, bisect_right as ub
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
from math import gcd, ceil, sqrt
rd = lambda: sys.stdin.readline()
rdm = lambda: map(int, sys.stdin.readline().split())
rdl = lambda: list(map(int, sys.stdin.readline().split()))
inf = 2 * 10 ** 18
sys.setrecursionlimit(10 ** 7)
rg = range
wt = print
mk2d = lambda n,m: [[0]*m for i in range(n)]

a,b,c=rdm()
if a==0:
	if b==0:
		wt(-1 if c==0 else 0)
	else:
		wt(1)
		wt(-c/b)
	exit()

d=b*b-4*a*c
if d>=0:
	sq = sqrt(d)
	wt(2)
	x = (-b+sq)/(2*a)
	y = (-b-sq)/(2*a)
	if x>y:x,y=y,x
	wt(x)
	wt(y)
elif d==0:
	wt(1)
	wt(-b/(2*a))
else:
	wt(0)
0