## Search found 10 matches

Mon Dec 21, 2009 5:56 pm
Forum: Volume 117 (11700-11799)
Topic: 11730 - Number Transformation
Replies: 7
Views: 3743

### Re: 11730 - Number Transformation

Thanks Asif. I was wrong in my interpretation: from 4 to 12 I was doing: 4 -> 6 -> 8 -> 10 -> 12 = 4 operations. And the correct is 4 -> 6 -> 9 ->12 = 3 operations because after the number are transformed to 6 I can use the prime factor 3 to add. To solve, I used 2 approach: 1) recursive backtrackin...
Fri Dec 18, 2009 10:56 pm
Forum: Volume 117 (11700-11799)
Topic: 11716 - Digital Fortress
Replies: 39
Views: 10700

### Re: 11716 - Digital Fortress

Also, You must use (for example):
char text[10001];
to read the line and a output that can store 100x100 chars data
example: char output[101][101];
Fri Dec 18, 2009 10:52 pm
Forum: Volume 117 (11700-11799)
Topic: 11716 - Digital Fortress
Replies: 39
Views: 10700

### Re: 11716 - Digital Fortress

Try: Input: 8 WECGEWHYAAIORTNU DAVINCICODE DTFRIAOEGLRSI TS ASDFASDFASDFASDF AB ABCABC ASDFGHASDFGHASDFGHASDFGAB ASDFGHASDFGHASDFGHASDFGABAB ASDFGHASDFGHASDFGHASDFGABASDFGHJKLOI Output: WEAREWATCHINGYOU INVALID DIGITAL FORTRESS AAAASSSSDDDDFFFF AAABBB CC AHGFDSAHGFDSAHGFDSAAGFDSB INVALID AAAABHSSSSA...
Fri Dec 18, 2009 6:31 pm
Forum: Volume 117 (11700-11799)
Topic: 11730 - Number Transformation
Replies: 7
Views: 3743

### 11730 - Number Transformation

Please, somebody can help me with my test cases? I can´t find my error. 11730.in 6 12 6 13 10 24 10 25 94 141 39 52 39 65 39 78 20 26 20 35 20 25 6 6 10 25 22 66 21 30 33 470 12 260 100 1000 90 1000 94 141 9 12 12 9 4 6 4 12 0 0 11730.out Case 1: 2 Case 2: -1 Case 3: 7 Case 4: 3 Case 5: 1 Case 6: 1 ...
Wed Jun 17, 2009 7:45 pm
Forum: Volume 114 (11400-11499)
Topic: 11462 - Age Sort
Replies: 49
Views: 17553

### Re: 11462 - Ages Sort

Dears, only for couriously, there are here some performances tests that I can relate for this problem: Método Execution time bubleSort TLE (> 5 seconds) Qsort Stl with cin / cout 1.072 Quicksort with scanf / printf 0.786 secs (maybe not so good qsort!?) Mergesort with scanf / printf 0.656 secs (with...
Fri Dec 19, 2008 8:12 pm
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 26097

### Re: 10986 - Sending email

Dears. Forget dijkstra and heap, make heap, etc. I have implemented with some variances: 1 - Dijkstra with dinamic list (TLE) (using only #include <cstdio>) 2 - Dijkstra with STL make_heap (TLE) 3 - Dijkstra with heap (like recomended here using only #include <cstdio>) Accepted: tempo: 0.580 (2 days...
Thu Dec 18, 2008 11:25 pm
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 26097

### Re: 10986 - Sending email

Hello People. Follow some test cases to the problem (test using uva tookit: http://uvatoolkit.com/problemssolve.php) 75 6 3 0 2 0 1 50 2 1 70 0 2 150 2 1 0 1 1 0 33333 2 0 0 0 2 1 0 1 1 0 111 2 2 0 1 1 0 100 0 1 33 2 1 0 1 0 1 100 3 3 2 0 0 1 100 0 2 200 1 2 50 2 0 0 1 14 20 13 2 0 1 123 1 2 467 2 3...
Sat Oct 18, 2008 3:53 am
Forum: Volume 115 (11500-11599)
Topic: 11500 - Vampires
Replies: 10
Views: 4796

### Re: 11500 - Vampires - tips

Hi Naffi and Mostafa. You can use to D !=1 also. You must calcule n1 and n2: n1 = EV1/D (rounded to up) page 1 from article n2 = EV2/D (rounded to up) for at = 3 use the formula prob = n1 -------- n1 + n2 else prob = (1- (q/p)^n1 ) ---------------- (1-(q/ *** where (q/p) = (6-at)/at the second prob ...
Mon Oct 06, 2008 10:33 pm
Forum: Volume 115 (11500-11599)
Topic: 11500 - Vampires
Replies: 10
Views: 4796

### 11500 - Vampires

Hello!

I Found the key to solve:
In http://en.wikipedia.org/wiki/Gambler%27s_ruin You can find the Both Formulas
The first one is to solve when AT = 3 (P2 = n1/(n1+n2))
The second one is to solve when AT != 3 (P1 = 1- (q/p)^n1... where q = (6-AT)/AT ...

Good lock
Fri Oct 03, 2008 6:30 pm
Forum: Volume 114 (11400-11499)
Topic: 11492 - Babel
Replies: 18
Views: 10237

### Re: 11492 - Babel

Dear Anindya. I don´t know if you correct your code, anyway the error is because a small test is missing (bold) if(u==st) { x=adj ; v=x.dest; lv=x.cost[0]-'a'; if (x.cost.size() < dis[v][lv]) dis[v][lv]=x.cost.size(); x.tot=dis[v][lv]; q.push(x); } if you use the same map with bellman-ford you can o...