solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
n = input().split() x = int(n[1]) y = int(n[2]) n = int(n[0]) t = n -y res = n * y / 100 if not res == round(res): res = int(res)+1 res = int(-x +res) res = max(res,0) print(res)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.precision(1); cout << fixed; double n, x, y; cin >> n >> x >> y; double s = (y * n) / 100; int p = ceil(s) - x; if (p >= 0) cout << p; else cout << 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); double n, x, y; cin >> n >> x >> y; double needed = ceil(y / 100 * n); if (needed <= x) { cout << 0; } else { cout << needed - x; } }
7
CPP
#include <bits/stdc++.h> using namespace std; int main(int qtd, char* nome[]) { ios::sync_with_stdio(false); cin.tie(0); int n, x, y; cin >> n >> x >> y; int people = ceil(n * y / 100.0); cout << (x >= people ? 0 : people - x) << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; scanf("%d%d%d", &n, &x, &y); int t = x; while (((double)x / n) * 100 < y) { x++; } cout << x - t << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; signed main() { long long n, x, y; cin >> n >> x >> y; long long per = x * 100 / n; long long cnt = x; while (per < y) { cnt++; per = cnt * 100 / n; } cout << cnt - x; }
7
CPP
import sys from functools import reduce from collections import Counter import time import datetime import math # def time_t(): # print("Current date and time: " , datetime.datetime.now()) # print("Current year: ", datetime.date.today().strftime("%Y")) # print("Month of year: ", datetime.date.today().strft...
7
PYTHON3
a, b, c = map(int, input().split()) a = (c * a + 99) // 100 print(0 if a - b < 0 else a - b)
7
PYTHON3
a, b, c = map(int, input().split()) c/=100 a*=c a*=10 finals = 0 if a%10 > 0: a/=10 finals = int(a)+1 else: a/=10 finals = int(a) if finals <= b: finals = 0 print(finals) else: print(finals-b)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; int sum = n * y; if (sum % 100 == 0) { sum = sum / 100; } else { sum = sum / 100; sum++; } if (sum > x) cout << sum - x << endl; else { cout << 0 << endl; } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int n, x, y; int bin_search(int l, int r) { while (l != r) { int now = (l + r) / 2; if ((x + now) * 100 / n < y) l = now + 1; else r = now; } return l; } int main() { cin >> n >> x >> y; cout << bin_search(0, n * 100); }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, j, k, l; cin >> n >> x >> y; l = n * y / 100; if (l * 100 < n * y) l++; k = l - x; if (k > 0) cout << k << endl; else cout << 0 << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; long long per = n * y; if (((x * 100) / n) >= y) { cout << 0; } else { if (per % 100 == 0) per = per / 100; else per = per / 100 + 1; cout << abs(x - per); } }
7
CPP
def wizard(): k = 3 n, x, y = list(map(int,input().strip().split()))[:k] res = int((n*y / 100) + ((n*y % 100) != 0)) - x if res > 0: return res else: return 0 print(wizard())
7
PYTHON3
#include <bits/stdc++.h> int main() { int n, x, y; int s = 0, m = 0; scanf("%i %i %i", &n, &x, &y); if ((n * y) % 100 != 0) { s = ((n * y) / 100) + 1; } else { s = ((n * y) / 100); } if (s - x < 0) { printf("0"); return 0; } printf("%i", s - x); return 0; }
7
CPP
n,w,p=map(int,input().split()) x=(n*p)/100 if x%1==0: if int(x-w)>0: print(int(x-w)) else: print(0) else: if int(x)+1-w>0: print(int(x)+1-w) else: print(0)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int OO = (int)2e9; const double PI = 2 * acos(0.0); const double EPS = 1e-9; int dcmp(double a, double b) { return fabs(a - b) <= EPS ? 0 : a > b ? 1 : 2; } int DI[] = {-1, 0, 1, 0, 1, -1, -1, 1}; int DJ[] = {0, 1, 0, -1, 1, -1, 1, -1}; int main() { long long n, m, ...
7
CPP
from math import ceil n, x, y = map(int, input().split()) required = ceil(y * n / 100) print(max(0, required - x))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, k; cin >> n >> x >> y; k = (n * y) / 100 - x; while ((x + k) * 100 < y * n) k++; cout << max(k, 0); return 0; }
7
CPP
#include <bits/stdc++.h> int main() { int i, n, x, y; scanf("%d%d%d", &n, &x, &y); i = (y * n) / 100; if (i >= x) { if (y * n > i * 100) { i++; printf("%d\n", i - x); } else printf("%d\n", i - x); } else printf("0\n"); scanf("%d", &i); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int n, x, y, q; int main() { cin >> n >> x >> y; if (y * n % 100) q = y * n / 100 + 1; else q = y * n / 100; if (q > x) cout << q - x; else cout << 0; return 0; }
7
CPP
P, N , rate = map(int,input().split()) need = P * rate / 100 if (P * rate) % 100 == 0: need = P * rate // 100 else: need = P * rate // 100 + 1 if need > N: print(need - N) else: print(0)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; double a, y, b, x, c; int main() { cin >> a >> b >> c; x = a * (c / 100); if (x > b) cout << ceil(x) - b; else cout << '0'; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; void solve() { long long int a, b, c; cin >> a >> b >> c; long long int x = ceil(a * c * 1.0 / 100); x -= b; if (x < 0) x = 0; cout << x << endl; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); ; long long int t; solve(); return 0; }
7
CPP
l=input() l=l.split() n=int(l[0]) x=int(l[1]) y=int(l[2]) #print((y*n)//100) #print(-(y*n)) #print(-(y*n)//100) divisao inteira em python arredonda pra baixo k=(-(-(y*n)//100)) #print(k) k=k-x if k>=0: print(k) else: print('0')
7
PYTHON3
import math a,b,c=map(int,input().split()) print(math.ceil(-min(0,-a*c/100+b)))
7
PYTHON3
n, x, y = map(int, input().split()) p = 0 for i in range(10**6 + 1): if ( (x + p) / n) >= y / 100: print(p) break p += 1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; t = 1; while (t--) { double n, x, y, k; cin >> n >> x >> y; k = ceil((y / 100) * n) - x; if (k >= 0) cout << k; else cout << 0; } cerr << "Time taken : " << (float)clock()...
7
CPP
def main(): [n, x, y] = [int(_) for _ in input().split()] a = n / 100 * y - x if a <= 0: print(0) else: from math import ceil print(ceil(a)) if __name__ == '__main__': main()
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); int main() { int n, x, y; scanf(" %d %d %d", &n, &x, &y); int minimum_necessary = (n * y) / 100; if ((n * y) % 100) minimum_necessary++; int ans = minimum_necessary - x; printf("%d\n", ans < 0 ? 0 : ans); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; double i = (double)(y * n) / (100); int t = int(ceil(i)) - x; if (t > 0) cout << t; else cout << 0; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; struct s1 { int a; int b; }; bool cp(s1 a2, s1 b2) { if (a2.a != b2.a) return a2.a > b2.a; else return a2.b < b2.b; } int main() { float n, x, y, i, buf = 0; float f, d; cin >> n >> x >> y; f = n * y / 100; if (f == int(f)) d = int(f); else ...
7
CPP
#include <bits/stdc++.h> using namespace std; double x, y, n, z, t; int main() { cin >> n >> x >> y; z = x; t = (x / n) * 100; while (t < y) { x++; t = (x / n) * 100; } cout << x - z << endl; }
7
CPP
# Description of the problem can be found at http://codeforces.com/problemset/problem/168/A import math n, x, y = map(int, input().split()) print(max(0, math.ceil((n * y) / 100) - x))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, need4demon, puppets; cin >> n >> x >> y; need4demon = ceil((y / 100.0) * n); if (x >= need4demon) puppets = 0; else puppets = need4demon - x; cout << puppets << endl; }
7
CPP
n,x,y = input().split() n=int(n) x=int(x) y=int(y) p=(y/100)*n if(p!=int(p)): p=int(p+1) else: p=int(p) r=p-x if(r>=0): print(r) else: print(0)
7
PYTHON3
from math import ceil x, y, percentage = map(int, input().split()) ans = percentage / 100 * x if ans > y: print(ceil(ans - y)) else: print(0)
7
PYTHON3
n , w, p = map(int,input().split()) import math rq = math.ceil((p/100)*n) print(rq-w) if rq-w>0 else print(0)
7
PYTHON3
#include <bits/stdc++.h> const long long INF = 1000000007; const double cp = 2 * asin(1.0); const double eps = 1e-9; const long long mod = 1000000007; using namespace std; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int n, x; double y, P; scanf("%d %d %lf", &n, &x, &P); int ans = max(0, (i...
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d = 0; cin >> a >> b >> c; if ((c * a) % 100 != 0) { d = ((c * a) / 100) + 1; } else if ((c * a) % 100 == 0) { d = ((c * a) / 100); } if (d < b) cout << 0 << endl; else { cout << d - b << endl; } }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { long int n = 0, k = 0, x = 0, y = 0, t = 0; cin >> n >> x >> y; t = (n * y + 100 - 1) / 100; k = t - x; if (k > 0) { cout << k << "\n"; } else { cout << "0\n"; } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { long long int n, x, y; cin >> n >> x >> y; long long int z = 0.01 * y * n; if ((y * n) % 100 != 0) z += 1; if (x >= z) { cout << 0; return 0; } cout << z - x; return 0; }
7
CPP
from sys import stdin, stdout import math,sys from itertools import permutations, combinations from collections import defaultdict,deque,OrderedDict from os import path import bisect as bi import heapq def yes():print('YES') def no():print('NO') if (path.exists('input.txt')): #------------------Sublime-----------...
7
PYTHON3
n,x,y = map(int,input().split()) if (n*y)%100==0: if x<((n*y)//100): print((n*y)//100 - x) else: print(0) else: res = ((n*y)//100)+1 if x<res: print(res-x) else: print(0)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { double n, x, y; cin >> n >> x >> y; if (ceil((n * y) / 100) <= x) cout << "0"; else { cout << ceil((n * y) / 100) - x; } }
7
CPP
import math n,x,y=map(int,input().split()) p=math.ceil((y*n)/100) ans=abs(p-x) if p<x: print(0) else: print(ans)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; int people = n - x; int wizards = x; people *= 100; wizards *= 100; int needed = max(0, n * y - wizards); cout << (needed + 99) / 100 << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, r; cin >> n >> x >> y; r = (n * y + 99) / 100; cout << max(0, r - x) << endl; }
7
CPP
#include <bits/stdc++.h> int main() { int n, x, y, a; double m; scanf("%d%d%d", &n, &x, &y); m = (double)y / 100 * n; a = ceil(m - x); if (a >= 0) printf("%d", a); else printf("0"); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int n, x, y; int main() { scanf("%d%d%d", &n, &x, &y); int need = (n * y / 100) + ((n * y) % 100 == 0 ? 0 : 1); if (need <= x) puts("0"); else printf("%d\n", need - x); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; const int oo = 1e9; const int MAXN = 1e2; int main() { ios::sync_with_stdio(0); int n, x, y; scanf("%d %d %d", &n, &x, &y); printf("%d", max(0, int(ceil(double(n) * y / 100)) - x)); return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; scanf("%d %d %d", &n, &x, &y); int z = (y * n) / 100; if ((double)z < (y / 100.0) * n) { z = z + 1; } int p = 0; while (x + p < z) { p++; } cout << p << endl; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; int num1 = n * y / 100; double num2 = n * y / 100.00; if (num2 > num1) num1++; if (num1 > x) cout << abs(num1 - x) << endl; else cout << 0 << endl; return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; void solve() { long double n, x; long double y; cin >> n >> x >> y; long long int req = 0; if (((n * y) / 100 - (int)(n * y) / 100) == 0) { req = (n * y) / 100; } else { req = (n * y) / 100; req += 1; } if (x >= req) cout << 0; else cou...
7
CPP
#include <bits/stdc++.h> using namespace std; void fast() { std::ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); } long long arr1[1000000], arr2[1000000]; string ConverToString(long long n) { string Result; stringstream convert; convert << n; Result = convert.str(); return Result; } long lo...
7
CPP
#include <bits/stdc++.h> using namespace std; double N; int X; int main() { cin >> N >> X; double K; cin >> K; int goal = ceil(N * K / 100.0); cout << max(goal - X, 0); }
7
CPP
import math n,x,y = map(int,input().split()) req = int(math.ceil((n*y)/100)) if x>req: print (0) else: print (req-x)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; double tmp = ((double)n * 1.000 * y * 0.01); int r = ceil(tmp); if (r <= x) { cout << "0\n"; } else { cout << (r - x) << endl; } }
7
CPP
from math import ceil n, x, y = list(map(int, input().split())) a = y / 100 * (n) - x if a < 0: print(0) else: print(ceil(a))
7
PYTHON3
import math n,x,y = map(int, input().split()) extraPeopleNeeded = math.ceil(y*n/100) if(extraPeopleNeeded > x): print (extraPeopleNeeded - x) else: print(0)
7
PYTHON3
import math def wizards(n,x,y): percent=math.ceil((n*y)/100) if(percent>x): return(percent-x) else: return(0) n,x,y=list(map(int,input().split())) result=wizards(n,x,y) print(result)
7
PYTHON3
n, x, y = input().split() n, x, y = int(n), int(x), int(y) percent = ((y * n) / 100) if int(percent) != percent: percent += 1 percent = int(percent) ans = int(percent - x) if ans >= 0: print(ans) else: print(0)
7
PYTHON3
n,x,y=map(int,input().split()) d=0 p=(x*100)/n while p<y: d=d+1 x=x+1 p=(x*100)/n print(d)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; template <class T1> inline void debug(T1 _x) { cout << _x << '\n'; } template <class T1, class T2> inline void debug(T1 _x, T2 _y) { cout << _x << ' ' << _y << '\n'; } template <class T1, class T2, class T3> inline void debug(T1 _x, T2 _y, T3 _z) { cout << _x << ' ' <...
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int i, j, m, n, k, x, y; double per; cin >> n >> x >> y; for (i = 0;; i++) { if (floor(100 * ((double)(x + i) / n)) >= y) { cout << i; break; } } return 0; }
7
CPP
import math z=list(map(int,input().split())) n=z[0] x=z[1] y=z[2] c=(x/n) c=c*100 c=round(c,4) if(c>=y): print(0) else: p=(((y-c)*n)/100) print(math.ceil(p))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, i, j; cin >> n >> x >> y; i = (n * y) / 100; if (y * n != i * 100) i += 1; if (i > x) cout << i - x; else cout << "0"; }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); double i, j, k; cin >> i >> j >> k; double ans = ceil((k * i) / 100); if (j >= ans) cout << 0; else cout << ans - j; return 0; }
7
CPP
#include <bits/stdc++.h> double n, x, y, i; int main() { scanf("%lf%lf%lf", &n, &x, &y); for (;; i += 1.0) { if ((x + i) * 100 / n >= y) { printf("%.0lf", i); break; } } scanf(" "); }
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int atleast, required; int n, x, y; cin >> n >> x >> y; if (x > (n * y) / 100) required = 0; else { required = (n * y) / 100 - x; if (((n * y) % 100) > 0) required++; } cout << required; }
7
CPP
n,x,y=[int(x) for x in input().strip().split()] def ceil(val): if int(val)==val: return int(val) else: return int(val)+1 num = ceil(n*y/100) count = max(0,num-x) print(count)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; int porcentaje = ((n * y) + 99) / 100; cout << max(0, porcentaje - x) << '\n'; }
7
CPP
n, x, y = map(int, input().split()) need = round(n * y / 100) + (((n*y/100) > (n*y//100) and round((n*y)/100) < (n*y//100)+1 )) print(max(need - x, 0))
7
PYTHON3
import math arr=list(map(int,input().split())) total=arr[0] wiz=arr[1] per=arr[2] required=math.ceil((total*per)/100) # print("Required: ",required) if required<=wiz: print("0") else: print(required-wiz)
7
PYTHON3
from math import ceil def main(): mode="filee" if mode=="file":f=open("test.txt","r") #f.readline() #input() get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,x,y]=get() total = ceil((y/100)*n) if total >x: print(total-x) else: pri...
7
PYTHON3
n,x,y=list(map(int,input().split())) print(max((int(n*y/100+.99999)-x),0))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { double A, B, C; double D; cin >> A >> B >> C; double x1, x2; if (!A) { if (!B) { if (!C) { printf("-1"); return 0; } else { printf("0"); return 0; } } else { printf("1\n"); printf("...
8
CPP
a, b, c = map(float, input().split()) D = b ** 2 - (4 * a * c) if D < 0: print(0) elif a == 0 and b == 0 and c != 0: print(0) elif a == 0 and b == 0 and c == 0: print(-1) elif a == 0: x0 = c / -(b) print(1) print(x0) elif b == 0: print(1) print(0) elif D == 0 and (a > 0 or a < 0): x ...
8
PYTHON3
s=[int(n) for n in input().split()] if s[0]==0 and s[1]*s[2]!=0: print(1) print(-s[2]/s[1]) elif s[0]*s[1]!=0 and s[2]==0: print(2) a=0 b=-s[1]/s[0] p=[a,b] print('%6f'%min(p)) print('%6f'%max(p)) elif s[0]*s[2]<0 and s[1]==0: print(2) p=[(-s[2]/s[0])**.5,-(-s[2]/s[0])**.5] print('%.6f'%min(p)) pri...
8
PYTHON3
a,b,c=map(int,input().split()) if a==0: if b==0: if c==0: print(-1) else: print(0) else: print(1) print(-c/b) else: d=b**2-4*a*c if d>0: x1=(-b-d**0.5)/(2*a) x2=(-b+d**0.5)/(2*a) print(2) if x1<x2: print(...
8
PYTHON3
import math a, b, c = input().split() a = int(a) b = int(b) c = int(c) if a == 0: if b == 0: if c == 0: print(-1) else: print(0) else: if c == 0: print(1, 0.0, sep="\n") else: print(1, -c / b, sep="\n") else: if c == 0: ...
8
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { double A, B, C; cin >> A >> B >> C; if (A == 0 && B == 0 && C == 0) { cout << "-1"; return 0; } if (A == 0 && B == 0 && C != 0) { cout << "0"; return 0; } if (A == 0) { double z = (-C) / B; printf("1\n%.10lf", z); retur...
8
CPP
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if (a == 0) { if (b == 0 && c != 0) cout << 0 << endl; if (b == 0 && c == 0) cout << -1 << endl; if (b != 0 && c == 0) cout << 1 << endl << "0,0000000000" << endl; if (b != 0 && c != 0) { cout << 1 <<...
8
CPP
#include <bits/stdc++.h> int Delta(long a, long b, long c) { double delta; delta = (double)(b * b - 4 * a * c); if (delta > 0) return 2; else if (delta < 0) return 0; else return 1; } int main() { long a, b, c; double x1 = 0, x2 = 0, d, k, n = 0; scanf("%d%d%d", &a, &b, &c); d = (double)b ...
8
CPP
a, b, c = map(int, input().split()) ch1, ch2, ch3 = (a == 0), (b == 0), (c == 0) if ch1 and ch2 and ch3: answer = -1 elif ch1 and ch2: answer = 0 elif (ch1 and ch3) or (ch2 and ch3): answer = 1 answers = [0] elif ch1: answer = 1 answers = [-c/b] elif ch2: if -c/a > 0: answer = 2 ...
8
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { long long delta, a, b, c; cin >> a >> b >> c; delta = b * b - 4 * a * c; if ((a == 0) && (b == 0) && (c == 0)) { cout << -1 << endl; } else if ((a == 0) && (b == 0) && (c != 0)) { cout << 0 << endl; } else if ((a == 0) && (b != 0)) { cou...
8
CPP
a,b,c = list(map(int, input().strip().split())) import sys if a == 0: if b == 0: if c == 0: print(-1) sys.exit(0) else: print(0) sys.exit(0) else: print(1) print(-c/b) sys.exit(0) else: a,b,c = 1, b/a, c/a if b ==...
8
PYTHON3
from decimal import * a, b, c = map(int,input().split()) if a != 0: if b**2 - 4*a*c < 0: print(0) else: arr = [(-b + (b**2 - 4*a*c)**(0.5))/(2*a), (-b-(b**2 - 4*a*c)**(0.5))/(2*a)] if max(arr) == min(arr): print(1) print(float(Decimal(arr[0]))) else: ...
8
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int i, j, k; double a, b, c, t, x1, x2; scanf("%lf%lf%lf", &a, &b, &c); t = b * b - a * c * 4; if (a == 0 && b == 0 && c == 0) { printf("-1\n"); return 0; } if (a == 0) { if (b == 0) { printf("0\n"); return 0; } else { ...
8
CPP
#include <bits/stdc++.h> using namespace std; int main() { double a, b, c, d; cin >> a >> b >> c; if (!a && b) { cout << "1\n"; cout << fixed << setprecision(7) << (-c / b); return 0; } if (!a && !b && !c) { cout << "-1"; return 0; } d = b * b - 4 * a * c; if (d < 0 || (!a && !b && c...
8
CPP
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jun 16 03:38:40 2018 @author: anshul """ from math import sqrt a,b,c=list(map(int,input().split())) if a==0 and b==0 and c==0: print(-1) elif a==0 and b==0: print(0) elif a==0: print(1) ans=(-1*c)/b print(ans) else: d = b*b - 4*...
8
PYTHON3
a,b,c=map(int,input().split()) d=b*b-4*a*c if a==0: if b==0 and c==0: print(-1) elif b==0: print(0) else: print(f'1\n{-c/b}') elif d<0: print(0) else: s=sorted({(-b+d**.5)/(2*a),(-b-d**.5)/(2*a)}) print(len(s)) for i in s: print(f'{i:.5f}')
8
PYTHON3
import math as m a,b,c=[int(s) for s in input().split()] if a==0: if b==0: if c==0: print(-1) else: print(0) else: print(1) print(-c/b) else: if a<0: a,b,c=-a,-b,-c d=b**2-4*a*c if d>0: print(2) print((-b-m.sqrt(d))/(2*...
8
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { double a, b, c; while (cin >> a >> b >> c) { if (a == 0 && b == 0) { if (c == 0) cout << -1 << endl; else cout << 0 << endl; } else if (a == 0 && c == 0) cout << 1 << endl << 0 << endl; else if (b == 0 && c == 0...
8
CPP
def shovel(a,b,c): if a==0 and b==0 and c==0: return -1 if a==0 and b==0: return 0 if a==0 : print(1) return '%.5f'%(-c/b) if b==0: if c==0: print(1) return '%.5f'%(0) x=b*b-4*a*c if x<0: return 0 if x==0: print...
8
PYTHON3
a, b, c = map(int, input().split()) d = b**2 - 4*a*c if a == b == 0 == c: print(-1) elif d < 0 or a == b == 0: print(0) elif d == 0: print(1) print( "{0:5f}".format(round(-b/(2*a), 5))) elif a == 0: print(1) x = round(-c/b, 5) print( "{0:5f}".format(x)) else: print(2) x = "{0:5f}"...
8
PYTHON3
a, b, c = list(map(int, input().split())) if a == 0 and b == 0 and c == 0: print(-1) elif (b*b)<4*a*c: print(0) elif a == 0: if b == 0: print(0) else: print(1) print("{0:.5f}".format(-(c/b))) else: d = ((b*b) - 4*a*c) x1 = (-b + (d**0.5))/(2*a) x2 = (-b - (d**0.5))/(2*a) if x1 == x2: pr...
8
PYTHON3
from math import sqrt a, b, c = map(int, input().split()) det = b * b - 4 * a * c if a == 0: if b == 0 and c == 0: print(-1) elif b == 0: print(0) else: print(1) p = round(-c / b, 5) print(p) elif det < 0: print(0) elif det == 0: print(1) p = round(-b / (a * 2), 5) print(p) else: pr...
8
PYTHON3
#include <bits/stdc++.h> using namespace std; int a, b, c; int main() { while (cin >> a >> b >> c) { if (a == 0) { if (b == 0) { if (c == 0) puts("-1"); else puts("0"); } else { double ans = -(double)c / (double)b; printf("1\n%.5lf\n", ans); } ...
8
CPP
a, b, c = [int(a) for a in input().split()] if a == 0: if b == 0: if c == 0: print(-1) else: print(0) else: print(1) print(-c / b) else: D = b ** 2 - 4 * a * c if D == 0: print(1) print(-b / (2 * a)) elif D < 0: print(0)...
8
PYTHON3