Show all threads Hide all threads Show all messages Hide all messages |
AC with Pollard's rho algorithm | Keworker `~ | 2102. Michael and Cryptography | 18 Jul 2024 16:32 | 3 |
I pass this problem with Sieve of Eratosthenes, but i think solution with Pollard's rho algorithm is funnier, and wrote it too. If you cant pass it with this algo just use all prime modules from 1'000'000'007 to 1'000'001'393. Did you check small dividers? ro pollard works very poorly with them If TL let me check all with O(sqrt(n)), I do it. I invoke rho pollard only if can not pass test with O(sqrt(n)) |
If you have WA#47 | Keworker `~ | 2102. Michael and Cryptography | 14 Jul 2024 11:03 | 1 |
Test 47 is some number from 1e14 to 1e18 with correct answer "No". |
To admins | Sergei Barannikov | 2102. Michael and Cryptography | 3 May 2024 17:22 | 3 |
To admins Sergei Barannikov 19 Oct 2019 09:51 Please add the following testcase: 869637034218881024 = 2^18 * 1806487 * 1836383 The answer should be "Yes". My solution prints "No" and nevertheless has AC. Thank you! Good test. I found another good one. 999979520100663296. I think it's stronger. However I got AC before, but i was looking for a good test. Edited by author 29.10.2019 00:37 One of the largest allowed numbers 999999999987679232 = 2^19 * 1907348632789 where the second multiplier is a prime number. |
For WA#50 | Pat | 2102. Michael and Cryptography | 22 Apr 2023 12:38 | 1 |
Check 524288, should be NO. Test other cases where you have 19 factors, and the last one remaining is 1. |
TLE 41 | Smetya | 2102. Michael and Cryptography | 2 Apr 2023 23:37 | 1 |
TLE 41 Smetya 2 Apr 2023 23:37 who has ideas, what test it is? |
Test 23 | Daniial | 2102. Michael and Cryptography | 2 Apr 2023 15:57 | 2 |
Help please: Test 23, whats wrong, what test should chek? def sieve(n): lis = list(range(n + 1)) lis[1] = 0 for i in lis: if i > 1: for j in range(i + i, len(lis), i): lis[j] = 0 return [i for i in lis if i != 0] c = sieve(200) a = int(input()) if a == 0: print('No') i = 0 b = [] e = 0 while a != 1: if a%5 != 0 and a%2 != 0 and a%3 != 0: e +=1 break elif a % c[i] == 0: a /= c[i] b.append(c[i]) continue else: i += 1 d = str(len(b)) if len (b) == 20 or (len (b) == 19 and e != 0): print('Yes') else: print('No') In this code possible i > len(c) |
WA #38 | Furkat Ahrolov | 2102. Michael and Cryptography | 15 Aug 2021 16:40 | 1 |
WA #38 Furkat Ahrolov 15 Aug 2021 16:40 |
some tests | [MAI] do_v_5_strok | 2102. Michael and Cryptography | 12 Jan 2021 16:24 | 1 |
24303989349327424 = 2^6 * 11^14 (Yes) 79792266297612001 = 7^20 (Yes) 467851794974552912 = 7^1 * 2^4 * 11^15 (Yes) 566608619280937216 = 2^8 * 19^12 (Yes) 932195579567617600 = 5^2 * 2^6 * 17^12 (Yes) 999983616067108864 = 1953109^2 * 2^18 (Yes) 999197664639844352 = 19681^3 * 2^17 (Yes) 998848442311376896 = 15619^3 * 2^18 (No) 999999999987679232 = 1907348632789^1 * 2^19 (Yes) 798352691495399040 = 2^7 * 3^1 * 5^1 * 7^1 * 11^1 * 13^1 * 17^1 * 19^1 * 23^1 * 29^1 * 31^1 * 37^1 * 41^2 (Yes) |
Optimize your solution if you got TLE. | wiwi | 2102. Michael and Cryptography | 25 Nov 2020 20:01 | 1 |
I thought that using the sieve of Eratosthenes would slow down the program, but it turned out the opposite. |
Help me please | NegaTiv337 | 2102. Michael and Cryptography | 5 Nov 2020 03:21 | 1 |
Edited by author 05.11.2020 03:23 Edited by author 05.11.2020 03:23 Edited by author 05.11.2020 03:23 |
What is test 23? | Alexandr | 2102. Michael and Cryptography | 3 Nov 2020 23:57 | 1 |
|
2102, test 23 | Daniial | 2102. Michael and Cryptography | 2 Nov 2020 06:54 | 1 |
|
WrongAnswer #28 | GOR ABELYAN | 2102. Michael and Cryptography | 29 May 2020 13:26 | 4 |
Edited by author 29.05.2020 13:26 Edited by author 29.05.2020 13:26 Try to change this for (int i = 3; i <= Convert.ToInt32(Math.Ceiling(BigInteger.Log(n, 2))); i += 2) to this for (BigInteger i = 3; i * i <= n; i += 2) Btw, you do not need BigInteger here, long is enough. Edited by author 30.05.2020 21:39 After this you will receive TLE39, try to handle the case with two big multiplied prime numbers, for example 1000000007*1000000009. Edit: this is even easier, than I thought. Just change your for to for (BigInteger i = 3; i < 10000000; i += 2) Edited by author 29.05.2020 03:42 Edited by author 29.05.2020 03:42 |
Is task solvable in python? | Anatoly [sesc 17] | 2102. Michael and Cryptography | 10 May 2020 06:26 | 4 |
I was able to reach 28 test in Python 3. Я дошел до 28 теста на Python 3. Edited by author 24.11.2016 23:52 Yes, I solved this problem using Python Yes, you just have to do some optimizations |
TLE22 | Kogut.Ivan | 2102. Michael and Cryptography | 4 Nov 2019 22:16 | 7 |
TLE22 Kogut.Ivan 20 Nov 2016 14:02 I get TLE on 22 test. What can you advise? 1)In solution you must find all primes <= 10^7. 2)You must use that n<=10^18. 1. find all primes up to 2 millions 2. if remainder > 2 millions, check if it is a prime Why do you take this number? big number N = X*Y*(p1*p2*p3*....*p18) = X*Y*(A) A = at least 2^18 = 262144 So, X*Y = at most 10^18 / 2^18 = 3 814 697 266 000 So either X or Y is less than 10^7 Edited by author 05.11.2019 20:56 Edited by author 05.11.2019 20:57 |
AC, but which test gives TLE!? | lnxdx | 2102. Michael and Cryptography | 29 Oct 2019 00:41 | 1 |
Can someone provide a test, that makes the following code get TLE? // ITNOA #include<bits/stdc++.h> using namespace std; #define ll long long int main() { ll n; cin >> n; int cnt = 0; for (ll i = 2;i*i <= min((ll)1e18, n);i++) while (n%i == 0) { n /= i; cnt++; } if (n > 1) cnt++; if (cnt == 20) cout << "Yes\n"; else cout << "No\n"; } |
Hint (possible test) for WA50 | maslowmw | 2102. Michael and Cryptography | 11 Aug 2019 22:44 | 1 |
2^19 or another where factorized number = 19 |
solved on python | fatnet | 2102. Michael and Cryptography | 28 Mar 2019 18:12 | 1 |
0.436 seconds, 6840 kb just go to google and type there: monte carlo factorization --- this algo is O(N^1/4), so its O(1e4 * sqrt(2)) |
TLE on #39 | Barish_Namazov | 2102. Michael and Cryptography | 27 Feb 2019 12:56 | 4 |
Re: TLE on #39 George_Aloyan[PTS Obninsk][MIPT_DPQE] 27 Feb 2019 12:56 The least prime divider in tests is less than 1.1E6 (but checking till 8E7 will still got AC) |
WA47 | German | 2102. Michael and Cryptography | 7 Dec 2018 17:07 | 6 |
WA47 German 27 Feb 2017 14:20 1) Find the prime numbers up to 10,000,100 (Sieve of Eratosthenes) 2) if the sum is equal to 19 degrees, then the residue is prime to check What can you advise? 1) Up to 10M? 2M is enough. sqrt( 10^18 / 2^18) ~= 1.5M 2) "Yes" precondition: N > 1 "Yes" condition: sum is 20 and residue is 1 "Yes" condition: sum is 19 and residue>1 and residue is prime Could you show please code? AC Edited by author 09.03.2017 18:16 > if (kol == 20){ It's suspicious a bit. Please try test (2^20)*3, expected answer is No 3145728 No 20^20 * 3^1 sum 21 if I understand condition of the problem: 3^1*5^1*7^2*11^1*17^12*23^3 answer is "Yes" ? Edited by author 01.03.2017 13:26 |