Search found 15 matches

by ulin
Thu Sep 21, 2006 9:00 pm
Forum: Volume 110 (11000-11099)
Topic: 11099 - Next Same-Factored
Replies: 24
Views: 10655

There are too many datacases to solve it like you do.
Try to build answ integer (some candidates) using prime factors of n.
by ulin
Thu Sep 21, 2006 8:26 pm
Forum: Volume 110 (11000-11099)
Topic: 11099 - Next Same-Factored
Replies: 24
Views: 10655

Thanks!!!
by ulin
Thu Sep 21, 2006 8:10 pm
Forum: Volume 110 (11000-11099)
Topic: 11099 - Next Same-Factored
Replies: 24
Views: 10655

Last Contest - Problems A and F

What is wrong with solutions of this simple problems?

<cut>

Maybe there are simple bugs, but I can't find it.
Thanks for help.
by ulin
Sun Nov 28, 2004 7:16 pm
Forum: Volume 104 (10400-10499)
Topic: 10444 - Multi-peg Towers of Hanoi
Replies: 11
Views: 2839

Yes!
For n=0 I print 0
by ulin
Sat Nov 27, 2004 5:03 pm
Forum: Volume 104 (10400-10499)
Topic: 10444 - Multi-peg Towers of Hanoi
Replies: 11
Views: 2839

10444 - Multi-peg Tower of Hanoi - WA

Hi!
I use dp and I have no idea, why it get WA. (where it could be mistake in my program)
Maybe some tricky inputs?
Please, give me some tests.

Best Regards!
by ulin
Sat Sep 18, 2004 1:57 pm
Forum: C++
Topic: Compile Error... STL?
Replies: 6
Views: 2607

The problem is that libstdc++ doesn't supply hash function for strings. You have to write it yourself, which is preety easy since there is hash function for const char *. For instance you can try this code: [cpp]template<> struct hash< std::string > { size_t operator()( const std::string& x ) const...
by ulin
Fri Sep 17, 2004 2:38 pm
Forum: C++
Topic: Compile Error... STL?
Replies: 6
Views: 2607

Re: Compile Error... STL?

CDiMa wrote: OJ uses an old version of gcc... try this:
[cpp]
#include <hash_map.h>
[/cpp]
It doesn't work.. It's still CE
I don't know how to use STL without CE
Please help...

Best Regards
by ulin
Fri Sep 17, 2004 10:43 am
Forum: C++
Topic: Compile Error... STL?
Replies: 6
Views: 2607

Compile Error... STL?

Why this code get Compile Error? Please help... #include <stdio.h> #include <string> #include <hash_map> using namespace std; const int maxn = 11; int n,test; hash_map<string,int> person; char names[maxn][15]; char name[15]; int main() { int x,y; int ile,cash; while (scanf ("%d",&n)==1) { person.cle...
by ulin
Thu Aug 19, 2004 5:28 pm
Forum: Volume 6 (600-699)
Topic: 663 - Sorting Slides
Replies: 18
Views: 10770

I solved this problem by applying repeated Bipartite-Match algorithm. (N+1) of them to be precise.. where N indicates the number of slides. 8) I have got AC, but my time is not very well - 0.447 s - I do M Bipartite Match algorithm, where M is number of egdes in graph. It can be much more than N+1,...
by ulin
Mon Aug 16, 2004 4:27 pm
Forum: Volume 6 (600-699)
Topic: 663 - Sorting Slides
Replies: 18
Views: 10770

Thanks Sohel!

I thought, that all slides must be uniquely determined or in other case answer is "none". Thank you for help with understand.

Best regards!!!
by ulin
Sat Aug 14, 2004 11:04 pm
Forum: Volume 6 (600-699)
Topic: 663 - Sorting Slides
Replies: 18
Views: 10770

Consider this case: You have 5 points and slides: point 1 and 2 are in slides 1 and 2, point 3 lies in slides 1, 2 and 3, points 4 and 5 are in all 5 slides. Then points 1 and 2 must be the numbers of the first two slides, but which number is on slide 1 cannot be determined. But after you remove th...
by ulin
Thu Jul 01, 2004 6:16 pm
Forum: Volume 106 (10600-10699)
Topic: 10679 - I Love Strings!!
Replies: 101
Views: 48700

This links should be helpful

http://www.cs.uku.fi/~kilpelai/BSA04/le ... rint04.pdf
www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC1.html

first one is about Aho-Corasic
second one is simulation of this algo. It helped me to understand.
by ulin
Wed Jun 30, 2004 12:58 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23206

Sorry

I didn't realize that there is possible to compute answer in O(n) for one-dimensional problem.

Best Regards!
by ulin
Wed Jun 30, 2004 12:53 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23206

I don't get your complexity n^3
There may be both positive and negative integers.
Is there finally algorithm O(n^3) for this problem?
by ulin
Wed Jun 30, 2004 12:33 pm
Forum: Volume 106 (10600-10699)
Topic: 10604 - Chemical Reaction
Replies: 24
Views: 14944

I use some kind of dynamic programming (with many loops :P ) and get accepted. It finishes in 1.8s. I think the runtime can be further reduced if I modify the loops, or take care of tubes with the same chemical, ... I also use DP, but it much less efficienly than your algorithm. My program runs in ...

Go to advanced search