Search found 9 matches

by matrix2220
Tue Sep 09, 2014 5:25 pm
Forum: Volume 108 (10800-10899)
Topic: 10870 - Recurrences
Replies: 14
Views: 7885

Re: 10870 - Recurrences

Hint: | f(n+1) | | a1 a2 ...... ad | | f(n) | | f(n) | | 1 0 0 .... 0 | | f(n-1) | | . | = | 0 1 0 .... 0 | * | . | | . | | .............. | | . | | f(n-d+1) | | ...........1 0 | | f(n-d) | Generalization: | f(n+k) | | a1 a2 ...... ad |^k | f(n) | | f(n+k-1) | | 1 0 0 .... 0 | | f(n-1) | | . | = | ...
by matrix2220
Mon Sep 08, 2014 5:11 pm
Forum: Volume 103 (10300-10399)
Topic: 10325 - The Lottery
Replies: 14
Views: 5998

Re: 10325 - The Lottery

Hint: You are given N and M and you have M selected tickets numbered Tickets from 1 to N should not be divisible by any of the selected tickets for example if we have a, b, c, ... selected tickets then any ticket that is divisible by a or b or c or .... or LCM(a,b) or LCM(a,c) or ..... or LCM(a,b,c...
by matrix2220
Thu Sep 04, 2014 6:56 am
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18708

Re: 10484 - Divisibility of Factors

Given N and D, you are required to count number of N! factors that are Divisible by D. The trivial solution is to find N!, then find it's prime factors and find prime factors of D then subtract the common powers and multiply all powers. ex. N = 10 , D = 2 10! = 3628800 = 2^8 3^4 5^2 7^1 2 = 2^1 We n...
by matrix2220
Thu Sep 04, 2014 12:14 am
Forum: Volume 106 (10600-10699)
Topic: 10622 - Perfect P-th Powers
Replies: 47
Views: 24051

Re: 10622 - Perfect Pth Powers

Hi There, This is an explanation for the solution of the problem Theorem: All the powers in the prime factorization of an integer n is even iif n is a perfect square power number. This Theorem can be extended to any perfect pth power, so we will say: "All the powers in the prime factorization of an ...
by matrix2220
Wed Aug 06, 2014 4:35 pm
Forum: Volume 103 (10300-10399)
Topic: 10385 - Duathlon
Replies: 16
Views: 7131

Re: 10385 - Duathlon

Some Things You should know: ----------------------------------- 1) Contestants speed in km/hour 2) Time margin should be rounded before printing --------------- Hints: ------- 1) r = t - k 2) Ternary search on K 3) No solution if time margin is -ve ------------------------ Input: 7 2 3 4 4 3 100 9...
by matrix2220
Sat Aug 02, 2014 5:42 pm
Forum: Volume 107 (10700-10799)
Topic: 10721 - Bar Codes
Replies: 26
Views: 12326

Re: 10721 - Bar Codes

Hints: ------- Complete search over all bar widths, in each recursive call you should try to add a bar with all allowed width. Recursively do that until all your bars width = n and number of bars = k Here you found a solution. You can use a 2D array to store answers. in order not to re-calculate any...
by matrix2220
Mon Jul 14, 2014 8:58 pm
Forum: Volume 10 (1000-1099)
Topic: 1098 - Robots on Ice
Replies: 3
Views: 2020

Re: 1098 - Robots on Ice

Since I suffered at this problem, but finally I got AC (el7amdolilah), I would like to share my solution method (Explanation) with you all. Please use it only after trying hard to solve the problem. Notice: This is explanation of my code, I didn't include it. UVA - 1098 - Robots on Ice (ACM – World ...
by matrix2220
Tue Jul 08, 2014 5:47 pm
Forum: Volume 115 (11500-11599)
Topic: 11553 - Grid Game
Replies: 10
Views: 3204

Re: 11553 - Grid Game

First thought: Alice = 0; while(There Still rows) { get Min. of each row and add them in Min Array; get Max. value in Min Array; add M(i,j) to Alice; remove row i and column j; } print Alice; This algorithm gives right results in case Bob just select the column with the element with the min value in...
by matrix2220
Mon Jul 07, 2014 3:41 pm
Forum: Volume 112 (11200-11299)
Topic: 11242 - Tour de France
Replies: 5
Views: 2591

Re: 11242 - Tour de France

Drive ration = rear teeth / front teeth <<<<< Input 10 10 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 10 10 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 10 10 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 10 10 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54...

Go to advanced search