Search found 8 matches

by artie
Wed Jan 24, 2007 3:10 am
Forum: Volume 111 (11100-11199)
Topic: 11157 - Dynamic Frog
Replies: 22
Views: 18367

Nice to know you liked the problem!! :)

I was also thinking of a (binary search + greedy) solution but wasn't too sure about it. I basically wrote the judge solution with (binary search + network flow).

Can you share your greedy approach?
I am newbie in C++, so would you tell me please how could ...
by artie
Wed Jan 24, 2007 1:26 am
Forum: Volume 111 (11100-11199)
Topic: 11155 - Be Efficient
Replies: 15
Views: 13168

First, generate the sequence x like the problem description
Then, generate the sequence s ,
where s = x[0] + x[1] + ... x
While computing, you can set s = (s[i-1] + x ) % m; , because we only deal with the remainder modulo m

For each 0<=r<m, count the number of s , so that s % m = r
That means ...
by artie
Fri Jan 05, 2007 8:54 am
Forum: Volume 111 (11100-11199)
Topic: 11148 - Moliu Fractions
Replies: 19
Views: 15596

FAQ wrote:artie, try to avoid all 'runerror(200)' in your code
runerror would never execute if input and code is correct, so why it cause restricted function?

BTW, I removed it and got AC
by artie
Fri Jan 05, 2007 4:50 am
Forum: Other words
Topic: dynamic programming with profile
Replies: 1
Views: 2924

dynamic programming with profile

I wish you to post some problems from UVA which could be solved using dynamic programming with profile. I couldn't find anything with http://shygypsy.com
by artie
Fri Jan 05, 2007 4:32 am
Forum: Volume 111 (11100-11199)
Topic: 11148 - Moliu Fractions
Replies: 19
Views: 15596

In the contest I got AC, but in the oj I got restricted function. What should I do?

Code: Select all

got AC
by artie
Mon Jan 01, 2007 5:25 am
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 43067

To those who feel bad about the "empty string" thing:

I don't see why you feel bad. Maybe you don't have time to read the problem statement carefully, but it has made everything clear. As for empty strings, from the problem description:

Here, we consider also the empty string as a palindrome ...
by artie
Sun Dec 31, 2006 12:43 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 43067

Hi. I am newcomer in c++ language. I got ac in the contest with pascal, but same algorithm in c++ got wa. I wish somebody explain me, what is wrong in c++ code:


Taking input is faulty..
I don't know exactly what it is.. but try this..


scanf("%d", &t);
gets(s);
while (t--) {
gets(s ...
by artie
Sun Dec 31, 2006 12:02 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 43067

Giorgi wrote:there is no critical input. what algorithm did you use?
Hi. I am newcomer in c++ language. I got ac in the contest with pascal, but same algorithm in c++ got wa. I wish somebody explain me, what is wrong in c++ code:

Code: Select all

got AC

Go to advanced search