Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"Cardbluff is popular sport game in Telegram. Each Cardbluff player has ever dreamed about entrance in the professional layer. There are n judges now in the layer and you are trying to pass the entrance exam. You have a number k -- your skill in Cardbluff. Each judge has a number a_i -- an indicator of uncertainty about your entrance to the professional layer and a number e_i -- an experience playing Cardbluff. To pass the exam you need to convince all judges by playing with them. You can play only one game with each judge. As a result of a particular game, you can divide the uncertainty of i -th judge by any natural divisor of a_i which is at most k . If GCD of all indicators is equal to 1 , you will enter to the professional layer and become a judge. Also, you want to minimize the total amount of spent time. So, if you play with x judges with total experience y you will spend x cdot y seconds. Print minimal time to enter to the professional layer or -1 if it's impossible. There are two numbers in the first line n and k ( 1 <= q n <= q 10^6 , 1 <= q k <= q 10^{12} ) -- the number of judges and your skill in Cardbluff. The second line contains n integers, where i -th number a_i ( 1 <= q a_i <= q 10^{12} ) -- the uncertainty of i -th judge The third line contains n integers in the same format ( 1 <= q e_i <= q 10^9 ), e_i -- the experience of i -th judge. Print the single integer -- minimal number of seconds to pass exam, or -1 if it's impossible "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
48758091 |
dotorya |
D |
Jan. 22, 2019, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
58 |
2994 |
19251200 |
|
3000 |
48757618 |
ACRush |
D |
Jan. 22, 2019, 4:22 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1060 |
32665600 |
|
3000 |
48759308 |
aid |
D |
Jan. 22, 2019, 4:30 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1170 |
33280000 |
|
3000 |
48757563 |
TLE |
D |
Jan. 22, 2019, 4:22 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1388 |
47718400 |
|
3000 |
48759719 |
voover |
D |
Jan. 22, 2019, 4:32 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1903 |
41369600 |
|
3000 |
48745574 |
whzzt |
D |
Jan. 22, 2019, 3:29 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1029 |
42393600 |
|
3000 |
48758598 |
KADR |
D |
Jan. 22, 2019, 4:27 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1263 |
44544000 |
|
3000 |
48759654 |
MrDindows |
D |
Jan. 22, 2019, 4:31 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1856 |
17612800 |
|
3000 |
48755420 |
qoo2p5 |
D |
Jan. 22, 2019, 4:12 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
2308 |
37785600 |
|
3000 |
48758531 |
kefaa2 |
D |
Jan. 22, 2019, 4:27 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
2496 |
92979200 |
|
3000 |
remove filters
Back to search problems