Show all threads Hide all threads Show all messages Hide all messages |
WA 53 | Sasha Fedorova | 1854. Negotiations with Parthians | 8 Mar 2024 19:45 | 1 |
WA 53 Sasha Fedorova 8 Mar 2024 19:45 Thymus gives an error on test 53. What should I do? How do you even check what’s wrong? I enter the number 26584441929064321 and the program returns 26584441929064321, but another person on the forum wrote that this is the correct answer. What's the problem then? Please help Edited by author 08.03.2024 22:12 |
solution in python | Michael | 1854. Negotiations with Parthians | 4 Jun 2023 02:43 | 1 |
Can this problem be solved in python? Can't pass test 39 |
WA 36 | 👑TIMOFEY👑 | 1854. Negotiations with Parthians | 2 Jan 2023 17:46 | 1 |
WA 36 👑TIMOFEY👑 2 Jan 2023 17:46 U HAVE VERY VERY VERY STUPID ERROR IN YOUR CODE |
How do you solve this problem ? | rohit | 1854. Negotiations with Parthians | 25 Dec 2022 23:22 | 6 |
Some hints please. My algo takes too much time. You need factoring N by numbers 2..10^6. If after factoring N>1 and N not prime, then your N=p*q, where p and q - prime numbers. Edited by author 27.09.2011 16:46 most difficult case n=p*p, where p- is prime for it case quick _int64 sqrt(__int64 n) function is needed, in other cases there is a factor of n which is <1000000. svr what should be the output when n = p*p where p is prime ?? i guess just n ? becuase n is already odd and its the maximum ? Edited by author 19.01.2015 01:04 I just did straight forward factorization (with rho) of an input number and then divided it by primes that have an odd power in factorization. 0.31 ms, 1400 kb. Edited by author 08.07.2018 18:21 AC in 0.015 (in plain C) with something much simpler than RHO. - start factorizing the simplest way they teach you in the kindergarten - when the test reach large values, check if the reminder has a perfect square -- if so - return the square and count as it is a prime divisor ^2 (because even if it can be factorized, it will be an amount of multipliers ^2) -- if no - stop checking (because the reminders are obviously large prime values ^1 and can be ignored) - multiply all primes with even powers * primers with odd powers (n) >= 3 with power n-1 I bet it can be accepted in 0.001 if Intel C 7 was still a compiler option. |
WA#39 Can you help me? | SergeyGlazkov | 1854. Negotiations with Parthians | 3 May 2020 00:06 | 1 |
I understood my problem. It is about calculating sqrt, import math in python doing it wrong with very big numbers. Edited by author 03.05.2020 00:55 |
I have WA 36 | arrammis | 1854. Negotiations with Parthians | 30 Jan 2018 05:02 | 2 |
My solution pass's all tests presented here in the forum. But i get WA at 36 test, authors please help what's there???? <code> #include <iostream> using namespace std; int main() { __int64 n, i, a, b, c, maxC1 = 1, maxC2 = 1, maxC = 1; cin >> n; for (i = 1; i*i < 1000000; i += 2) { if (n % i == 0) { a = n/i; b = sqrtl((long double)a); c = sqrtl((long double)i); if (b*b == a && a > maxC1) { maxC1 = a; } if (c*c == i && i > maxC2) { maxC2 = i; } maxC = max(maxC1, maxC2); } } cout << maxC; return 0; } </code> Do I need to write own sqrt ? What the problem is ? Edited by author 22.01.2015 17:54 For test 36, make sure to use unsigned long longs to prevent overflow: 999999998000000001 999999998000000001 |
What is 33 Test? | ProeBos | 1854. Negotiations with Parthians | 6 Feb 2017 05:24 | 7 |
try this: 45000270000405 answer: 9000054000081 or this: 907500003300000003 answer: 302500001100000001 Edited by author 10.10.2011 10:41 907500003300000003 right is 1 To clarify: IFullMetalLeon is not telling the truth; the correct answer to 907500003300000003 is 302500001100000001. and you could try 100102036020202601, the answer is 10010202601 I'm stuck on test 33. Please, explain, is 9000054000081 really correct answer? 9000054000081 = 3^2 + 100000600009^1. It obviously has even divisors: (2+1) * (1+1) = 6. They are 1, 3, 9, 100000600009, 300001800027, 900005400081. And 302500001100000001 is prime, thus it has 2 divisors (1 and self). Where am I wrong? 302500001100000001=550000001^2 And is has 3 uneven divisors: 1, 550000001, 302500001100000001. And every X=Y^2 has uneven number of uneven divisors. Edited by author 31.05.2012 18:57 |
WA#39 | nikitaevg | 1854. Negotiations with Parthians | 15 Sep 2013 16:34 | 1 |
WA#39 nikitaevg 15 Sep 2013 16:34 Write your own sqrt function (with blackjack and hookers) with supporting __int64 and it'll be OK. It helped me. Edited by author 15.09.2013 16:35 |
What a test 53? | SS123 | 1854. Negotiations with Parthians | 7 Jun 2013 11:39 | 1 |
All tests on this forum gave the correct results ... I do not know what the problem is. Please, help!!!! |
Test 25 ? | watashi | 1854. Negotiations with Parthians | 27 Feb 2012 21:43 | 1 |
n=p*q. (p>1000000 and q>1000000). p and q are two big different primes. Edited by author 28.02.2012 02:02 |
WA#53 | Valentin (PSU) | 1854. Negotiations with Parthians | 12 Oct 2011 17:43 | 2 |
WA#53 Valentin (PSU) 12 Oct 2011 17:23 I get AC input 26584441929064321 output 26584441929064321 |
no subject (-) | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1854. Negotiations with Parthians | 3 Oct 2011 22:13 | 1 |
no subject (-) Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 3 Oct 2011 22:13 Edited by author 04.10.2011 00:02 |
Tests are too simple/incomplete | Oyster | 1854. Negotiations with Parthians | 26 Sep 2011 12:18 | 2 |
I think tests for this problem are incomplete or too simple (or invalid), they should be more strict. For instance, my AC code returns output "1" for input "363" but it's incorrect - obviously output should be "121" since it's valid and bigger than 1. In general, test cases (big_prime * big_prime * relatively_small_prime) and/or similar should be added. Edited by author 26.09.2011 05:51 |
No subject | tryit1 | 1854. Negotiations with Parthians | 24 Sep 2011 19:52 | 5 |
I get WA on test 11. Why is that ? I run a loop from 1 to sqrt(n) ,for each i , i check if i is odd or n/i is odd and a perfect square , if yes i store it in ans. int main() { long long n,i; long long ans=1; scanf(" %lld",&n); for(i=3;i*i<=n;i++){ if((n%i)==0){ long long j=sqrtl(i); if (j*j==i and (i&1)) ans=max(ans,i); j=sqrtl(n/i); if (j*j==(n/i) and ((n/i) &1) ) ans=max(ans,n/i);
} } printf("%lld\n",ans); return 0; } IF YOU DID'N GET WA,YOU STILL GOT TLE!!! 悲催啊!!! try 9. I think it should output 9. And this algo seems to output 1. Edited by author 24.09.2011 19:52 |