Common BoardI have got AC on this problem. In the description, it says "accuracy to 0.0001". In the code which I submitted, I use printf("%.4lf\n", min_breakage); to match the point. When I use the sample input, my output is 3.0000. But the sample output is 3. So I think the sample output may be wrong. Or both the two outputs are correct? I had MLE because of bug in segment tree. In test 14: n = 0. #include <iostream> using namespace std; int main() { long long a, b, c, d; int r = 0, g; cin >> a >> b; cin >> c >> d; g = (a + b * (c - a + d) / (b + d)) - ((a + b * (c - a + d) / (b + d)) % b); cout << g << endl; return 0; } Edited by author 02.10.2020 16:52 i dont know why my code is failing test 4.can any body give me a series of test cases where this kind of program may fail. please help n=0 Answer 10 but i think if n<10 then least possible number will be n. your solution makes it 2 digit. The task is to find a minimal POSITIVE number, so 0 doesn't work. I am learning Golang and rewriting my solutions from C++ to Golang, changes should no affect the result, but it started failing either on test #2 or test #6. Could you, please, provide me those tests to understand what is the problem? Thanks! Edited by author 29.09.2020 01:07 Ok, looks like in my case the format of input data in tests #2 and #6 is differ from the one in the example. Accepted Go code is: package main import ( "fmt" "sort" ) type city struct { n, x, y int } func main() { var n int fmt.Scan(&n) m := make([]city, n) for i := 0; i < n; i++ { m[i].n = i + 1 fmt.Scan(&m[i].x, &m[i].y) } sort.Slice(m, func(i, j int) bool { if m[i].x < m[j].x { return true } return false }) for i := 0; i < n; i += 2 { fmt.Println(m[i].n, m[i+1].n) } } time: 0.14 memory: 2 044 КB Edited by author 29.09.2020 01:10 Try this test 4 4 !### ABAA AABA *##$ The answer is 2 An easy and simple o(n) solution exists. pretty basic did anyone solve it with python? oh i found my mistake Edited by author 03.11.2014 12:28 4 -1 -2 -3 -4 -5 0 -7 -8 -9 -1 -127 -100 -3 -4 -7 -1 I have WA on tc 4 too and am unable to figure it out. Some help? #include <stdio.h> #include <iostream> #include <algorithm> using namespace std; int main() { int N1, C1, N2, limit, C2, N3, n, time = 0, mins, secs, ans; cin >> N1 >> C1 >> N2 >> limit >> C2 >> N3 >> n; for (int i = 0; i < n; i++) { scanf("%d:%d", &mins, &secs); ans = mins * 60 + secs; time += ans > 6 ? (ans + 59) / 60 : 0; } cout << "Basic: " << N1 + time*C1 << '\n' << "Combined: " << N2 + max(time - limit, 0) * C2 << '\n' << "Unlimited: " << N3; } Edited by author 25.09.2020 23:01 Hello, as you can see ( http://acm.timus.ru/status.aspx?author=52097 ), my solve cant get AC. For all my test cases it looks like very good. Probably I have a little bug or something else and I cant find this mistake (WA on test #10). After many hours spenting for this problem I dont know where could it be. Please, give me simple hint or fail testcase. My solution at work on those tests: 4 1 1 1 1 0 4 3 1 3 3 inf 4 8 12 4 6 inf 6 4 4 2 4 2 2 inf 3 5 3 7 1 3 8 8 3 2 3 32 64 3 2 3 36 225 1225 2 3 16777216 1594323 5764801 1 3 16777216 1594323 11529602 2 6 2365440 2 3 5 7 11 2 It looks like good for big tests too. Please help. What is the #10 test? Edited by author 03.09.2016 20:56(my solution provide 4 answers at all: infinity, 0, 1, 2) You're welcome~ Edited by author 04.09.2016 18:23 . Edited by author 24.09.2020 17:19 Help me please! looks like "aaaa" answer should be full string. input: aaaa output : aaaa give me any hint, plz Yes Search up Markov chains. To solve this problem you have to build a state transition matrix and compute its sufficiently large power. For this Test case , AC solution gives output 2 which should be 1. 25 28 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 1 5 19 19 20 20 21 21 22 22 23 23 24 24 25 25 14 15 22 6 22 1 10 22 Edited by author 20.02.2020 05:33 Edited by author 20.02.2020 05:33 is 1 the correct answer ? Nvm Edited by author 23.09.2020 15:53 6 1 1 0 0 4 0 6 1 10 2 6 2 4 1 5 answer is 8 Please notice the POINT: If both players have "two of a kind", then the ranks of paired cards are compared first, and if they are equal, then the ranks of the thirds cards are compared. I think this is the one easiest to have been ignored. (Sorry for my poor English) Hi, What about the scenario where both players have flush ? In texas holdem whosoever has higher highest card wins and if they are the same then it's a tie. So what should be the answer for the following test case. 4C 6C 8C 3H 4H 8H AS AD Mine is Artyom because both player's best hand is eight high flush (even though the next best card of sasha (6) is greater than next best card of dima (4)). Ok, the answer for previous test case is Sasha because Sasha's second card is higher than Dima's ( whose best hand is also flush) second highest card (as they both have the same hand). This turned out to be a little different from the normal texas holdem poker as there only the highest card matters which is correct because two players in texas holdem cannot have same high card for flush. But here its a different story. > This turned out to be a little different from the normal texas holdem poker as there only the highest card matters which is correct because two players in texas holdem cannot have same high card for flush. LOLWUT? I have correct answer at least on first test, but I got WA1! Why? Is first test different with a test in a problem's description? I write each line of my answer via Scala println (similar with Java), and read with StdIn.readLine. Edited by author 25.08.2019 19:14 Edited by author 25.08.2019 19:15 use double for ALL variables Test 9 is about the possibility of the shoot. For example I just changed < on <=: if (4 * (pow(x1 - xc, 2) + pow(y1 - yc, 2) - pow(r, 2)) <= pow(x2 - x1, 2) + pow(y2 - y1, 2)) { |
|