Search found 19 matches

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

I got accepted and my outputs are:

Code: Select all

5
10
14
11
10
14
13
by domino
Tue Mar 06, 2007 2:26 am
Forum: Volume 111 (11100-11199)
Topic: 11193 - Infinix
Replies: 10
Views: 3601

sclo wrote:did you handle cases like these properly?

1+1+1-1-1+1-1-1-1+1+1+1-1-1

Which operations could be done last?
If A=S=M=D=1 my program outputs 5. Is it correct?
by domino
Tue Mar 06, 2007 1:21 am
Forum: Volume 111 (11100-11199)
Topic: 11193 - Infinix
Replies: 10
Views: 3601

11193 - Infinix

I tried solving this one with dynamic programming but I keep getting WA. Does anybode have some tricky test cases?
by domino
Sun Mar 04, 2007 3:20 pm
Forum: Volume 111 (11100-11199)
Topic: 11190 - Series of Powers
Replies: 18
Views: 11276

How do you solve this without getting TLE? I tried an O((H-L)*lgK) approach but it did not fit the timelimit.
by domino
Sun Apr 02, 2006 11:40 pm
Forum: Volume 110 (11000-11099)
Topic: 11016 - Square Counting
Replies: 19
Views: 7322

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...
by domino
Sun Apr 02, 2006 6:51 pm
Forum: Volume 110 (11000-11099)
Topic: 11016 - Square Counting
Replies: 19
Views: 7322

I would really appreciate some test cases. I can't figure out why I keep getting WA.
by domino
Tue Mar 28, 2006 5:30 pm
Forum: Volume 110 (11000-11099)
Topic: 11016 - Square Counting
Replies: 19
Views: 7322

I have also used plane sweep , but i get WA. Does the polygon self-intersect? Could someone provide some testcases please?
by domino
Tue Mar 14, 2006 2:37 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38465

Can anyone give some hints as to how to obtain O(N*2^N) solution? I had an O(N^2*2^N) solution , that got ACC in about 0.7s after some heavy optimizations, but i doubt that is the official solution.
by domino
Tue Oct 18, 2005 6:44 pm
Forum: ACM ICPC Archive Board
Topic: 3292 - Matrissor (From Dhaka 2005-2006)
Replies: 18
Views: 4852

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......
by domino
Mon Oct 17, 2005 4:30 pm
Forum: ACM ICPC Archive Board
Topic: 3292 - Matrissor (From Dhaka 2005-2006)
Replies: 18
Views: 4852

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...
by domino
Fri Apr 22, 2005 3:28 pm
Forum: Algorithms
Topic: A problem
Replies: 9
Views: 1648

Isn't this just a pigeon-hole principle application?
Is your array is A[1]... A[n] just compute S = A[1] + A[2] + .. + A
if any S % N == 0 then you have a solution (A[1] A[2] .. A), otherwise there will be an S equal to S[j] (i < j) and the solution is A[i+1] A[i+2]...A[j].
by domino
Fri Apr 22, 2005 8:28 am
Forum: Volume 108 (10800-10899)
Topic: 10837 - A Research Problem
Replies: 25
Views: 7435

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...
by domino
Thu Apr 21, 2005 6:29 pm
Forum: Volume 108 (10800-10899)
Topic: 10837 - A Research Problem
Replies: 25
Views: 7435

Oh, and by the way, how are people solving this in under 0.1s? I have 0.5s runtime after hashing the results with a STL map. Could someone share some hints? (i see Adrian Kuegel for example has a really fast solution)
by domino
Thu Apr 21, 2005 6:24 pm
Forum: Volume 108 (10800-10899)
Topic: 10837 - A Research Problem
Replies: 25
Views: 7435

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 ...
by domino
Thu Apr 21, 2005 2:09 pm
Forum: Volume 108 (10800-10899)
Topic: 10837 - A Research Problem
Replies: 25
Views: 7435

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...

Go to advanced search