Search found 91 matches

by StatujaLeha
Sun Aug 06, 2006 9:44 am
Forum: Volume 110 (11000-11099)
Topic: 11056 - Formula 1
Replies: 34
Views: 16587

please, give me output for next test cases: 3 Schumacher : 1 min 23 sec 172 ms Barrichello : 2 min 12 sec 999 ms Senna : 0 min 55 sec 582 ms 4 Schumacher : 1 min 23 sec 172 ms Barrichello : 2 min 12 sec 999 ms Senna : 0 min 55 sec 582 ms Fangio : 1 min 03 sec 000 ms 2 BadPilot : 59 min 59 sec 999 ms...
by StatujaLeha
Sat Jul 29, 2006 7:11 pm
Forum: Volume 110 (11000-11099)
Topic: 11002 - Towards Zero
Replies: 39
Views: 17759

In my Java solution I used a set (as suggested by misof in yet another thread on this problem) to determine different sums in each row, so I could build the table (which is not needed, but it was easier for me). I didn't use memoization (unless you count adding an element to a set that already cont...
by StatujaLeha
Sat Jul 29, 2006 8:21 am
Forum: Volume 110 (11000-11099)
Topic: 11002 - Towards Zero
Replies: 39
Views: 17759

Have you read all other threads on this problem?
Yes, of course. I have only understood that there are various kinds of memoization's implementation. I want to know if there is a faster implementation than with using std::map<> as cache. :)
by StatujaLeha
Fri Jul 28, 2006 7:51 pm
Forum: Volume 110 (11000-11099)
Topic: 11002 - Towards Zero
Replies: 39
Views: 17759

11002 How do you do memoization for this problem?

I get TLE on this problem. I think it can be because I use for memoization std::map<>. Please tell about how do you do memoization for this problem?
by StatujaLeha
Mon Jul 24, 2006 10:24 am
Forum: Volume 110 (11000-11099)
Topic: 11055 - Homogeneous squares
Replies: 16
Views: 7839

Hi!
I solved this problem, but i have one question.
My first algorithm got TLE. It worked in O(n^3). Did someone get accepted with algorithm with complexity O(n^3)?
by StatujaLeha
Fri Jul 21, 2006 11:51 am
Forum: Volume 110 (11000-11099)
Topic: 11032 - Function Overloading
Replies: 43
Views: 16851

Hi all! Please, give me some hint to avoid TLE. How I try to solve this problem now: 1. I found all numbers A for which there is number I such I + sod(I) == A. I remember it in bool IsSelfNumber[]. 2. For numbers A < 5000001 i store in MyArr[A] number of numbers from punkt 1, which <= A. 3. I rewrit...
by StatujaLeha
Fri Jul 14, 2006 5:06 pm
Forum: Volume 3 (300-399)
Topic: 347 - Run
Replies: 20
Views: 6023

347 Run, Run, Runaround Numbers

Hi all! I am interested in who how solved it? I did precompute some values of the runaround numbers at my computer and insert them to a programm as an array. If an input number is greater than the lowest array's element and is lower than the biggest array's element then i find answer in the array. O...
by StatujaLeha
Sat Apr 29, 2006 7:18 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

What is not very clear to me is the following: OK, we have n trees and we need to cut down m. Does that mean that if we cut down more than m trees this is also a solution or are we required to cut down exactly m trees I think (not 100% sure), I just have the feeling that ... Well, sometimes in orde...
by StatujaLeha
Thu Apr 13, 2006 7:50 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

Help me please

Hi all. I really don't understand what is wrong with my solution. I try to use the approach posted int this topic but get WA :( Please help me. #include <iostream> #include <vector> #include <algorithm> #include <bitset> #include <math.h> int n; struct Point { int m_x; //x-coordinate of point int m_...
by StatujaLeha
Sun Mar 19, 2006 10:52 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8954

You're trying to find the i and j for which this function is maximal: |xi-xj|+|yi-yj|+|zi-zj| Suppose you know i, what do you know about j? (hint: there are 8 cases) Have I understood right that you propose to find vertexes that form сonvex polyhedron and then find maximum distance between this poi...
by StatujaLeha
Sun Mar 19, 2006 8:39 am
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8954

This problem is not so difficult. Once you got a simple idea, you can make out a linear algorithm. Another Hint) The manhattan distance between (0, 0) and (2, 3) between (0, 0) and (3, 2) between (0, 0) and (5, 0) ... is same. It is clear how to calculate the distance between two cabbages. Can you ...
by StatujaLeha
Wed Mar 15, 2006 10:36 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

I have changed my solution: 1. I find all sets of points that lie on the same line and there are no two sets that one of them is the subset of another. 2. I use structure Cache to store solutions for subtasks. std::map< int, /* quontity of trees to be cut off * / std::map< PointSet,/* set for that w...
by StatujaLeha
Tue Mar 14, 2006 7:29 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

When you send code to the judge, it attempts to compile it. If you try to use a feature that is not allowed due to security reasons (like creating an ofstream or whatever you are doing in the part you didn't show), it will not compile. Only code that compiles successfully can be tested against test...
by StatujaLeha
Tue Mar 14, 2006 2:00 pm
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

Krzysztof Duleba wrote:But this is a compilation-time error, it doesn't mean that n != tmpN as your code doesn't compile and doesn't run at all. Try assert instead.
Sorry, but i don't understand what do you mean :( Can you explain it more clear?
by StatujaLeha
Tue Mar 14, 2006 7:05 am
Forum: Volume 110 (11000-11099)
Topic: 11008 - Antimatter Ray Clearcutting
Replies: 81
Views: 38672

From the code segment you posted, n seems to be declared as a global variable. And you call the Point constructor in the for loop. Did you access the variable n in the Point constructor? yes, n is the global variable and i change its value only in this function. Try to cout both n and tmpN in the f...

Go to advanced search