|
|
It can be at least 3 lines of code if you write one statement per line (in plain C) double k1, k2, k3; scanf("%lf %lf %lf", &k1, &k2, &k3); printf("%.0lf", /* The Expression */); Edited by author 24.03.2023 00:40 from the betting coefficient k is (m + n) / n I think k must be greater than 1. Don't you think so? First I used my own method for reading data, this function: http://paste.ubuntu.com/475799/ GOT TLE 5... Then used this method: double[] data = Console.ReadLine().Split().Select(s => double.Parse(s)).ToArray(); GOT AC... Whats the 5 test? is it bug in my reading function or what? Need help. PS Check last @Crash@: http://acm.timus.ru/status.aspx?space=1&num=1582&author=73720 Code: if (data[0].IndexOf('.') == -1 || data[1].IndexOf('.')==-1 || data[2].IndexOf('.')==-1) throw new System.DivideByZeroException(); Some of numbers are NOT with floating point. From problem statement: В единственной строке через пробел записаны 3 числа с плавающей точкой k1, k2 и k3. Edited by author 10.08.2010 14:02100 - is the floating point number too. I think it should be "100.0" 100 - is the floating point number too. Edited by author 06.09.2009 21:29 Equation Edited by author 06.09.2009 21:26 Algorithm for this problem is O(1). You should to think a little. My algorithm is O(1) and it is AC, but in 0.015 why??? Yes I did it! This problem wasn't solved by me, first, but after a few lists of paper i saw how stupid this problem is! and of course i feel honored because of my own solution! Hi. Sorry can you explain me the second sample test. 1.25 10.0 5.75 ? How much money has he put for each of coefficients. Just solve this system: k1*x1==k2*x2==k3*x3 x1+x2+x3==1000 Man interested why so. Simply if examply k1*x1>max(k2*x2,k3*x3) we will lost in case of mistake with first result. Edited by author 27.10.2007 22:22 Edited by author 27.10.2007 22:23 but isn't it to print k1*x1? |
|
|