## Search found 14 matches

Wed Feb 25, 2015 5:08 pm
Forum: Volume 11 (1100-1199)
Topic: 1182 - Sequence Alignment
Replies: 4
Views: 1557

### Re: 1182 - Sequence Alignment

brianfry713 wrote:You do not have to insert gaps, a mismatched char gives a score of 0.
Ah! You're right; it got accepted.

The problem statement didn't mention anything about that, and the sample did not help either

Anyway, thanks!
Sat Feb 21, 2015 9:17 pm
Forum: Volume 11 (1100-1199)
Topic: 1182 - Sequence Alignment
Replies: 4
Views: 1557

### Re: 1182 - Sequence Alignment

What is the correct output for the following input: 3 SA SB AS BS AB CD My code gives: 0 1 -1 My best right alignment for those cases are: SA- S-B A-S BS AB-- CD and the score are 2-1-1 = 0, 2-1 = 1, and -1 respectively. But uDebug gives: 2 2 0 Did I misunderstand the problem? What does it mean by "...
Fri Jun 04, 2010 3:37 pm
Forum: Volume 117 (11700-11799)
Topic: 11721 - Instant View of Big Bang
Replies: 12
Views: 6293

### Re: 11721 - "Instant View of Big Bang"

Have the test data been fixed? My algorithm for this problem is: 1. Detect all negative cycles using Bellman-Ford algorithm. I use dist[] = {0} as the initial distance for all nodes. 2. For any node that lies in negative cycle, I push it into a queue. Node b lies in negative cycle if edge a-b can up...
Tue May 27, 2008 7:23 pm
Forum: C++
Topic: What -O and -O2 optimization do?
Replies: 1
Views: 1690

### What -O and -O2 optimization do?

I wonder what kind of optimization does GNU C/C++ do with -O1 and -O2. I do some googling but still can't get the clear idea about the optimization detail. int p = 0; for ( int i = 0; i < 1000000000; i++ ) for ( int j = 0; j < 1000000000; j++ ) for ( int k = 0; k < 1000000000; k++ ) p += i * 5; If y...
Tue Jan 08, 2008 8:08 am
Forum: Volume 113 (11300-11399)
Topic: 11379 - Chichi's Home Work
Replies: 12
Views: 2984
Arggh! so there's a clarification They haven't fixed the sample output for this problem yet.

Thanks Rio.
Fri Sep 14, 2007 1:25 pm
Forum: Volume 112 (11200-11299)
Topic: 11260 - Odd Root Sum
Replies: 22
Views: 11567
I didn't understand quite well what you mean here: If there is subtraction in your code, try to make this in terms of addition something. (I don't know what you do). Here is an example: Supposed that we want to calculate (a-b)%m where a = 10, b = 5, and m = 3. This is what we expect from the equati...
Tue Sep 11, 2007 8:20 pm
Forum: Volume 112 (11200-11299)
Topic: 11260 - Odd Root Sum
Replies: 22
Views: 11567
My AC code returns 82064896 for Piklu_sust's last input.

INPUT:

Code: Select all

``````4611686018427387903
0
``````
CORRECT OUTPUT:

Code: Select all

``````82064896
``````
Fri May 25, 2007 8:17 pm
Forum: Volume 112 (11200-11299)
Topic: 11201 - The problem of the crazy linguist
Replies: 21
Views: 10109
Victor Barinov wrote:Oh!

"...and start with the same letter than w"
I don't understand this part. Does it mean "all valid words that start with x1" ?
Mon Mar 05, 2007 5:33 am
Forum: Volume 111 (11100-11199)
Topic: 11191 - Square
Replies: 23
Views: 13596

### Re: asd

hi,can anybody help me..i use O(n^3) algo. sclo already give you the answer. Figure out what made a number perfect square. There should be only 2^10 different values (excluding -/+). And be careful with zero :D what type of variable that i have to used ?coz the value < 10^18.. C/C++: long long (%lld)
Thu Mar 01, 2007 6:16 am
Forum: Volume 111 (11100-11199)
Topic: 11182 - Zeroes III
Replies: 12
Views: 4857
At last, I got accepted using O(log n . log b). Thank you for your hint :) input: 8191 8192 1000000 2 1000000 2310 1000000 6720 1 2 2 864 5 10 10 10000 48 219 100 5 2133 504 2610 30 3248 219 4511 888 8950 66 42610 3000 84511 7323 63702 864 63702 1431 244080 67 955467 6 958356 496 958356 3502 984673 ...
Tue Feb 27, 2007 6:06 am
Forum: Volume 111 (11100-11199)
Topic: 11182 - Zeroes III
Replies: 12
Views: 4857

### 11182 - Zeroes III

Is there any 'advance' number theory involved in this problem? O(n) is not fast enough. I've tested the judge with O(n) dummy code (input and loop), and it run for 5s :o . My best algorithm was O(nlog b) using prime factorization, which is obviously give me TLE. I use this formula: F2(n) = 1^S(n) . ...
Sun Apr 02, 2006 7:14 am
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 22878
This problem can be solved without using floating-point data type. I figured this one out after getting alot of WA when using float/double to solve this problem

hint : use prime factoring and gcd..
Sun Apr 02, 2006 7:05 am
Forum: Volume 110 (11000-11099)
Topic: 11026 - A Grouping Problem
Replies: 28
Views: 18463
ups.. too late. someone has replied my question. yeah. it's a very stupid mistake :oops: I've just figured this out. How can ( 4! / 3! ) be 3... :lol: shouldn't fall into this again.. btw, my friend also participate in this contest and i asked the same question to him. but he also forgot 1.3.4 :) ho...
Sun Apr 02, 2006 6:09 am
Forum: Volume 110 (11000-11099)
Topic: 11026 - A Grouping Problem
Replies: 28
Views: 18463
I don't understand this problem at all.. I think this problem wants us to compute max-fitness from all K-combination out of N elements ( 1 <= K <= N ), but I don't see any relation between this idea and the problem's Sample I/O. eg. on 2nd sample i/o : 4 100 1 2 3 4 if K = 0 --> 0... if K = 1 --> 1 ...