Search found 19 matches

by Kentaro
Sat Oct 29, 2005 5:45 am
Forum: Volume 101 (10100-10199)
Topic: 10127 - Ones
Replies: 32
Views: 12288

Sample Input?

Can someone who has gotten AC offer some sample input? It is really hard to verify cases by hand for me but despite every test I throw at it working, I still get WA. Also, what should the output be if the input number is 0, or divisible by 2 or 5? EDIT: I rethought the main loop of my program and th...
by Kentaro
Sat Apr 16, 2005 4:56 am
Forum: Volume 101 (10100-10199)
Topic: 10131 - Is Bigger Smarter?
Replies: 93
Views: 64064

You need to be careful of elephants with the same weight, same IQ, or same weight and same IQ. The sequence you produce has to have strictly increasing weights and strictly decreasing IQ's. For example, the following are invalid sequences of elephants for (weight, IQ) pairs. (1000, 4000) (2100, 3000...
by Kentaro
Wed Apr 13, 2005 6:20 am
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 50655

Something wrong with judge?

Important Edit : A straight LCS-based solution worked like a charm and I've finally gotten AC for this problem. But I wonder what was wrong with this program? The Programming Challenges judge accepts my program just fine, which seems to work exactly according to the problem specification (it assume...
by Kentaro
Sat May 29, 2004 2:49 am
Forum: Volume 4 (400-499)
Topic: 457 - Linear Cellular Automata
Replies: 25
Views: 11708

Well, when I read the problem (this was some weeks ago) it didn't seem to say anything about how to handle the multiple input. If it had, I would have gotten AC a lot sooner.

Well, I got my AC so no more complaints from me. I'll have to see about reading problems even more carefully from now on.
by Kentaro
Fri May 28, 2004 4:10 am
Forum: Volume 4 (400-499)
Topic: 457 - Linear Cellular Automata
Replies: 25
Views: 11708

Okay. I'll fix what I'm doing to read the input that way and see what happens. But it wouldn't have hurt for them to specify that more clearly somewhere... :(
by Kentaro
Wed May 05, 2004 4:58 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 179012

I find when I'm compiling C++ programs to test them before submitting that there are some libraries that my implementation includes implicity (i.e. I don't have to use #include to get them) but they need to be explicitly included when the judge is compiling the program. I try to be really careful wi...
by Kentaro
Fri Apr 23, 2004 10:33 pm
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 17465

Yeah, your code looks like it triggers integer division by mistake when printing out the estimate. You don't want integer division here. Try changing the 6 to 6.0 in your printf; that should trigger floating point division which you do want. Or you can do as the previous poster suggested and change ...
by Kentaro
Fri Apr 23, 2004 2:47 am
Forum: Volume 4 (400-499)
Topic: 457 - Linear Cellular Automata
Replies: 25
Views: 11708

I'm trying to solve this too but in C++. I'm not sure what I'm doing wrong, the code seemed so easy... Please help. :cry: EDIT: Fixed the mixed-up loop indexes (inside a for loop over the variable i I had other for loops over the variable i. That'd be bad) but still WA... [cpp] using namespace std; ...
by Kentaro
Sun Apr 18, 2004 1:22 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 21641

If you're using the length of LCS algorithm on the sequences exactly as they appear in the input, you are out of luck. There is a subtlety to this problem that you haven't accounted for. I compiled your code on my own system and run the Sample Input 2 on it and gotten the wrong answer. Sample Input ...
by Kentaro
Wed Mar 03, 2004 12:25 am
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 52694

That's not true either. Think of 22000. The difference between the sum of the even and odd digits is 4 which is not divisible by 11. Does anyone have a good rule for determining if a number is divisible by 11? EDIT: Sorry, that post is correct. A number is divisible by 11 if the difference between t...
by Kentaro
Tue Mar 02, 2004 3:10 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 77473

1 4 3 7 5 10 is a jolly jumper of 6 integers. (equivalent to input: "6 1 4 3 7 5 10") |1 - 4| = 3 |4 - 3| = 1 |3 - 7| = 4 |7 - 5| = 2 |5 - 10| = 5 All the numbers from 1 to 5 are seen at least once in the above list so the sequence is a jolly jumper. They don't have to be seen in any particular orde...
by Kentaro
Tue Mar 02, 2004 3:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 77473

You spelled the output wrong?
"Jolly", "Not jolly"

In your code I see:
"Jolly", "Not yolly"
by Kentaro
Tue Mar 02, 2004 2:57 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 21641

Each number r in the sequence means that event i has rank r . So let's look at the correct sequence as given in the input. 3 1 2 4 9 5 10 6 8 7 This means: event 1 has rank 3 event 2 has rank 1 event 3 has rank 2 event 4 has rank 4 event 5 has rank 9 event 6 has rank 5 event 7 has rank 10 event 8 ha...
by Kentaro
Sat Feb 28, 2004 3:01 am
Forum: Volume 100 (10000-10099)
Topic: 10033 - Interpreter
Replies: 88
Views: 24549

I'm confused too...

I understand this problem pretty well but the problem statement doesn't say anything about what should happen if the interpreter comes across an illegal instruction. Should the interpreter halt? Will a case like this even occur?
by Kentaro
Sat Feb 21, 2004 6:34 am
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 44756

Changed my approach to solving the problem to the suggestion of finding the mean rounded down to two decimal places, finding the amount spent above and below said mean and outputting the smaller amount. Still WA and now I'm convinced that there's some stupid round-off error lurking somewhere.... Ple...

Go to advanced search