Общий форум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)) { I figured out that n == 8 in test 2. It may be useful for somebody. I got my problem I erased from multiset in a wrong way what is the whole test case ? . i am getting wrong answer on test case 2 ! My AC solution returns 55555556 2 My answer is 61313 68558 Hi, Mine is same as Howard Liu i.e. 55555556 2 Varun > My answer is 61313 68558 This is an answer for 6553562057. I also get 55555556 2 for 111111113. pls help, what is in test №14 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var tokens = Console.ReadLine().Trim(). Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); var a = int.Parse(tokens[0]); var b = int.Parse(tokens[1]); var c = int.Parse(tokens[2]); var d = int.Parse(tokens[3]); var min = a + (c - a) / (b + d) * b; var max = c - (c - a) / (b + d) * d; min = Math.Min(min + b, Math.Max(min, max)); max = Math.Max(max - d, min); Console.WriteLine(max); Corrected, see !!! sign Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var tokens = Console.ReadLine().Trim(). Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); var a = int.Parse(tokens[0]); var b = int.Parse(tokens[1]); var c = Math.Max(int.Parse(tokens[2]), a); // !!!! var d = int.Parse(tokens[3]); var min = a + (c - a) / (b + d) * b; var max = c - (c - a) / (b + d) * d; min = Math.Min(min + b, max); max = Math.Max(max - d, min); Console.WriteLine(max); } This is strange: "The driver would not ask a sum that is less than that offered by Petr." #include<bits/stdc++.h> using namespace std; int gcd(int a,int b){ if(b==0)return a; return gcd(b,a%b); } int main() { int a,b,c,d; cin>>a>>b>>c>>d; int carry=(c-a)%(b+d); int res=(c-a)/(b+d); if(carry==0){ cout<<a+res*b<<'\n'; } else if(carry>=b){ cout<<a+(res+1)*b<<'\n'; } else if(carry<b){ cout<<c-res*d<<'\n'; } } why wrong ans in test #6? if u wanna break your programm type sys.exit() (don't forget to type import sys in the beginning of the programm) _____________________ если вы хотите полностью прервать вашу программу, то импортируйте библиотеку sys и пропишите sys.exit() |
|