Search found 277 matches

by UFP2161
Sat Aug 07, 2004 1:35 pm
Forum: C++
Topic: Woes of strstream
Replies: 4
Views: 2037

Doesn't this work?

[cpp]
strstream *in;

int main()
{
while(cin >> blah)
{
in = new strstream(blah);
doit();
delete in;
}
}
[/cpp]
by UFP2161
Thu Aug 05, 2004 5:31 pm
Forum: Volume 2 (200-299)
Topic: 216 - Getting in Line
Replies: 57
Views: 24467

My program outtputed the first one, but it shouldn't matter since the description states that:
No two computers are at identical locations and each computer will be listed once.
by UFP2161
Thu Aug 05, 2004 3:43 pm
Forum: Volume 4 (400-499)
Topic: 485 - Pascal's Triangle of Death
Replies: 50
Views: 4762

Doubles do not have enough precision to answer this question correctly.
by UFP2161
Sat Jul 31, 2004 12:50 pm
Forum: General
Topic: Range of integer
Replies: 4
Views: 952

Well, it is a 32-bit processor for a reason, meaning it's optimized for 32-bit instructions, not 64-bit.
by UFP2161
Fri Jul 30, 2004 12:48 am
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 26599

In order to determine if a number is prime, you only need to check all the prime numbers from two to the square root of that number.
by UFP2161
Wed Jun 30, 2004 12:16 am
Forum: Volume 106 (10600-10699)
Topic: 10677 - Base Equality
Replies: 11
Views: 3412

You have to figure out what 9240 (base 10) is in base 11, and then use that number to do the actual checking between base 11 and base 14.
by UFP2161
Tue Jun 15, 2004 8:51 pm
Forum: Volume 106 (10600-10699)
Topic: 10669 - Three powers
Replies: 14
Views: 5792

You are right.. I (and probably he) read input as %lld.. should be %llu.. but judge apparently does not test this fact (maybe they really meant less than 19, and not less than or equal to)
by UFP2161
Tue Jun 15, 2004 1:33 pm
Forum: Volume 106 (10600-10699)
Topic: 10604 - Chemical Reaction
Replies: 24
Views: 14870

Use memoization on that fact that you only have 10 possible tubes.
by UFP2161
Mon Jun 14, 2004 5:48 pm
Forum: Volume 3 (300-399)
Topic: 386 - Perfect Cubes
Replies: 53
Views: 7140

There is no input for this problem. You are to find and output all sets with a <= 200.
by UFP2161
Mon Jun 14, 2004 5:45 pm
Forum: Volume 1 (100-199)
Topic: 146 - ID Codes
Replies: 35
Views: 5685

cxxoc --> occxx
by UFP2161
Mon Jun 14, 2004 5:38 pm
Forum: Volume 6 (600-699)
Topic: 671 - Spell checker
Replies: 27
Views: 10188

Multiple Input.
by UFP2161
Mon Jun 14, 2004 5:16 pm
Forum: Volume 106 (10600-10699)
Topic: 10669 - Three powers
Replies: 14
Views: 5792

Dreamer #1's output is correct.. If you think about it, any odd input number should not have "1" as it's first output.. likewise, any even input number should..
by UFP2161
Sun Jun 13, 2004 2:16 pm
Forum: Volume 105 (10500-10599)
Topic: 10543 - Traveling Politician
Replies: 25
Views: 7217

After some number of speeches my array holds a 1 if the city can be reached, and a 0 if it cannot, and thus can traverse from there. You only need to know whether a city can be reached w/ some number of speeches before it.
by UFP2161
Sun Jun 13, 2004 7:08 am
Forum: Volume 105 (10500-10599)
Topic: 10543 - Traveling Politician
Replies: 25
Views: 7217

It depends on how you're using your queue.. maybe queue is the wrong term for what I did.. a better term would be having used two min cost arrays.. one for current depth, one for next depth..
by UFP2161
Sat Jun 12, 2004 10:34 pm
Forum: Volume 105 (10500-10599)
Topic: 10543 - Traveling Politician
Replies: 25
Views: 7217

I used two queues, both of size 52. I don't know why you need one that's much bigger than that.

Go to advanced search