Search found 73 matches

by rjhadley
Sat Aug 04, 2007 8:39 am
Forum: Bugs and suggestions
Topic: Status Stuck In "Received"
Replies: 0
Views: 1716

Status Stuck In "Received"

I submitted a solution to 10190 but it was never judged; it's stuck in "Received". I got an e-mail saying it was accepted: Your C++ program has solved Ok the problem 10190 (Divide, But Not Quite Conquer!) in 0.002 seconds with low memory spent. Congratulations! However, the online judge shows that i...
by rjhadley
Wed Jul 25, 2007 8:43 am
Forum: C++
Topic: Judge's annoying compiler
Replies: 1
Views: 1956

gcc 2.95.3

Have you tried something like ios::fixed? of using cout.setf(ios:fixed)?
by rjhadley
Sat Feb 26, 2005 10:49 am
Forum: Volume 1 (100-199)
Topic: 154 - Recycling
Replies: 29
Views: 3262

Almost Human wrote:Try the following input:
r/G,o/P,y/S,g/A,b/N
r/P,o/S,y/G,g/A,b/N
r/G,o/P,y/S,g/A,b/N
e
#

your program produces :
3

the correct one should produces :
1
Your input here is ambiguous. However,
Problem Specification wrote:Note that there will always be a clear winner.
by rjhadley
Sat Feb 14, 2004 7:02 am
Forum: Volume 101 (10100-10199)
Topic: 10128 - Queue
Replies: 9
Views: 7748

Thanks Adrian! I switched from a backtracking approach to a dynamic programming approach and that solved it in 0.094 seconds. :)

(I think I was mislead by Skiena & Revilla's Programming Challenges, which lists this as a backtracking problem).
by rjhadley
Sat Feb 07, 2004 5:48 am
Forum: Volume 101 (10100-10199)
Topic: 10128 - Queue
Replies: 9
Views: 7748

How does everyone solve this problem so quickly? I've tried backtracking, but it is way too slow. My method is: (a) decide how many people, L, should be to the left of the tallest person (b) split the people into to the L to the left of the tallest person and thus, the remaining N - L - 1 people are...
by rjhadley
Sat Jan 31, 2004 4:27 am
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40351

I don't think
0010 9
is valid input. But for
10 9
the output should be
1
.

Also, it looks like the new input set might have whitespace problems since there are only 39 AC, but 802 PE...
by rjhadley
Fri Jan 30, 2004 5:53 am
Forum: C
Topic: Compiler version
Replies: 7
Views: 4002

I think they've upgraded their compiler recently as I've gotten a few "new judgements" in the past month or so that went from AC to CE. :-(
by rjhadley
Wed Jan 28, 2004 5:41 am
Forum: Volume 103 (10300-10399)
Topic: 10304 - Optimal Binary Search Tree
Replies: 24
Views: 12504

Recall that the order of the elements is the same as the order of the given frequencies and the tree must be a binary search tree. For input 5, 10, 20 20 e3 / \ <=> / \ 5 10 e1 e2 So your tree isn't a binary search tree. The optimal binary search tree is 20 e3 / / 10 <=> e2 / / 5 e1 since the access...
by rjhadley
Sat Jan 10, 2004 8:43 pm
Forum: Other words
Topic: Why Do You Keep Changing Problem Specifications?
Replies: 10
Views: 3252

And if you don't mind "rjhadley" for which problem you got 20K code? The only problem where I've used more than 20KB for source code is for 10311 Goldbach and Euler...that's a hard problem! A good chunk of that size is a list of Carmichael numbers (I'm using a Miller-Rabin primality test so I need ...
by rjhadley
Wed Jan 07, 2004 11:56 pm
Forum: Other words
Topic: Why Do You Keep Changing Problem Specifications?
Replies: 10
Views: 3252

Most of AC submissions with 0.000 time were a 20Kb precalculated table and just scanf and printf. I don't think that's a good way to improve anyone's skill in programming. I agree that this situation should be avoided, but is changing the input size limit really the best solution? For example, have...
by rjhadley
Sat Jan 03, 2004 8:26 pm
Forum: Other words
Topic: Why Do You Keep Changing Problem Specifications?
Replies: 10
Views: 3252

Why Do You Keep Changing Problem Specifications?

Problem 623 is called 500! and it's previous specification said Assumptions: Value of a number ``n" which factorial should be calculated of does not exceed 500. So why did you change it to 1000? What "mistake" did that "fix"? All these changes only frustrate people. It is hard enough to solve proble...
by rjhadley
Fri Jan 02, 2004 10:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 22999

Wilansky decided later that a (simple and unsophisticated) prime number is not worth being a Smith number and he excluded them from the definition. So perhaps this should be the corresponding output: 4937775 4997814 5445476 4648833 4898031 5789901 9554636 8545667 7564550 8798870 6787920 5789722 646...
by rjhadley
Fri Jan 02, 2004 7:20 pm
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 32265

SilVer DirectXer: but..how do u guys discover that all twins prime are subset of (6*k-1,6*k+1), for k is integers? Let q and q + 2 be twin primes. The number between them is (clearly) q + 1. Aside from 2, every prime number is odd. So q and q + 2 must both be odd, as both are prime. Hence, q + 1 is ...
by rjhadley
Tue Dec 30, 2003 8:37 am
Forum: Volume 105 (10500-10599)
Topic: 10597 - Right Words
Replies: 4
Views: 2506

10597 - Right Words

Is it just me or are there extraneous spaces in the judge's input? I finally got it accepted after (only) changing the input parsing logic as follows: a) to end parsing the production rules, look for any line containing the character "#" or any line not containing the string "->" (instead of looking...
by rjhadley
Tue Dec 30, 2003 5:05 am
Forum: Other words
Topic: end input loop
Replies: 2
Views: 1037

Unless the problem states otherwise, loop until you reach end-of-file. How you detect end-of-file depends on your choice of language and your choice of input function. For example: [cpp]while( true ) { int i, j; cin >> i >> j; if( cin.eof() ) { break; } // process query } [/cpp] [c]int i, j; while( ...

Go to advanced search