結果

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

ソースコード

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)
	wt((-b+sq)/(2*a))
	wt((-b-sq)/(2*a))
elif d==0:
	wt(1)
	wt(-b/(2*a))
else:
	wt(0)
0