Code: Select all

```
5
10
14
11
10
14
13
```

- Tue Mar 06, 2007 10:55 am
- Forum: Volume 111 (11100-11199)
- Topic: 11193 - Infinix
- Replies:
**10** - Views:
**3658**

I got accepted and my outputs are:

Code: Select all

```
5
10
14
11
10
14
13
```

- Tue Mar 06, 2007 2:26 am
- Forum: Volume 111 (11100-11199)
- Topic: 11193 - Infinix
- Replies:
**10** - Views:
**3658**

- Tue Mar 06, 2007 1:21 am
- Forum: Volume 111 (11100-11199)
- Topic: 11193 - Infinix
- Replies:
**10** - Views:
**3658**

I tried solving this one with dynamic programming but I keep getting WA. Does anybode have some tricky test cases?

- Sun Mar 04, 2007 3:20 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11190 - Series of Powers
- Replies:
**18** - Views:
**11391**

- Sun Apr 02, 2006 11:40 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11016 - Square Counting
- Replies:
**19** - Views:
**7469**

I don't get it, I do it exactly like you explained. Here is my code: #include <stdio.h> #include <math.h> #include <algorithm> using namespace std; #define MAX_N 105 #define EPS 1e-9 #define FOR(i, a, b) for (i = (a); i < (b); i++) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define pb push_back #defi...

- Sun Apr 02, 2006 6:51 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11016 - Square Counting
- Replies:
**19** - Views:
**7469**

- Tue Mar 28, 2006 5:30 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11016 - Square Counting
- Replies:
**19** - Views:
**7469**

- Tue Mar 14, 2006 2:37 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11008 - Antimatter Ray Clearcutting
- Replies:
**81** - Views:
**40656**

- Tue Oct 18, 2005 6:44 pm
- Forum: ACM ICPC Archive Board
- Topic: 3292 - Matrissor (From Dhaka 2005-2006)
- Replies:
**18** - Views:
**4984**

Just maintain two 2D arrays the one should contain the minimal amount of matrix ( i don't know the plural :) ) and the other the minimal cost of multiplying the last few matrix in a given interval. Rostislav P.S. read the statment carefully i.e. you cannot use the proccesor like this : A*(...)*B......

- Mon Oct 17, 2005 4:30 pm
- Forum: ACM ICPC Archive Board
- Topic: 3292 - Matrissor (From Dhaka 2005-2006)
- Replies:
**18** - Views:
**4984**

The same idea also works for more complicated test cases: if you want to evaluate a sequence of matrices ((A1, A2, ..., Ak), (B1, B2, ..., Bm)), check whether it's possible to evaluate it as (A1, A2, ..., Ak, (B1, B2, ..., Bm)). Can you give more details please? I have tried a similar algorithm, wi...

- Fri Apr 22, 2005 3:28 pm
- Forum: Algorithms
- Topic: A problem
- Replies:
**9** - Views:
**1711**

- Fri Apr 22, 2005 8:28 am
- Forum: Volume 108 (10800-10899)
- Topic: 10837 - A Research Problem
- Replies:
**25** - Views:
**7578**

As far as I understand : let's say you do this res1 = calc_N_from_PHI_N(J) ; res2 = calc_N_from_PHI_N(num/J); 1) If res1 and res2 have no common divisor than we have no problem. In this case we generate res1*res2 and we put it in the list of our candidates for N ( whose phi(N)==num ) . 2) If they h...

- Thu Apr 21, 2005 6:29 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10837 - A Research Problem
- Replies:
**25** - Views:
**7578**

- Thu Apr 21, 2005 6:24 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10837 - A Research Problem
- Replies:
**25** - Views:
**7578**

Well, it seems you figured it out that tests like 20 and 2000 weren't working because you didn't treat the case when the phi_n = p^k*(p-1) (p prime) and the minimal n could have been p^(k+1) (it's not always p^(k+1) as you realised that for 32 it was 51). So, my test case is like this: N = 33817088 ...

- Thu Apr 21, 2005 2:09 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10837 - A Research Problem
- Replies:
**25** - Views:
**7578**

The output for that case is 33817088 , check it out because it is worth it. My algorithm is very similar to yours (actually i started solving this task after reading your posts) and i finally got accepted after fixing my program to work for this case (although it was pure luck, i don't know how to p...