Search found 293 matches

by chunyi81
Sun Oct 21, 2007 7:34 am
Forum: Java
Topic: Input data - Compile Error
Replies: 4
Views: 4078

Try BufferedReader and StringTokenizer for input parsing. For printing, try the old System.out.print and System.out.println methods.
by chunyi81
Fri Sep 14, 2007 6:09 pm
Forum: Bugs and suggestions
Topic: You have -2 tries left
Replies: 6
Views: 2590

I had some problems logging into the new judge server. I provided the right username and password but was directed back to the log in page. My account is activated but was locked as I tried many times to get the registration activation e-mail to be sent to the e-mail address I provided. Is it possib...
by chunyi81
Sat Sep 08, 2007 9:04 am
Forum: Bugs and suggestions
Topic: 496 - Simply Subsets
Replies: 6
Views: 4306

Hi,

Check this part of your code:

Code: Select all

    char* c = NULL; 
    *c = '\0'; 
You declared a char pointer c pointing to NULL. Then the next line deferences c (pointing to NULL) and this will give a runtime error.

Hope this helps.
by chunyi81
Thu Aug 23, 2007 6:40 am
Forum: Volume 112 (11200-11299)
Topic: 11218 - KTV
Replies: 11
Views: 6213

Try the following case:

Input:

Code: Select all

3
1 2 3
3 4 5
4 5 7
0
Output:

Code: Select all

Case 1: -1
by chunyi81
Sat Aug 04, 2007 4:04 pm
Forum: Java
Topic: Why this code generate compile time error?
Replies: 2
Views: 3990

I believe your code is written for Java JDK 1.5 (Java SDK 5.0)?

The Java compiler in the OJ is gcj, which supports a Java JDK 1.1 and a subset of Java JDK 1.2
by chunyi81
Mon Jul 23, 2007 5:11 pm
Forum: Java
Topic: Data type in java
Replies: 4
Views: 4003

For primitive data types the max you can go in Java is 64 bits for a long (which is 32 bits for C/C++).

There are other types such as BigInteger, BigDecimal, to name a few.
by chunyi81
Fri Jul 06, 2007 6:23 pm
Forum: C++
Topic: How to check for blank line?
Replies: 5
Views: 3369

I think what you need is something like this:

Code: Select all

int main()
{
    string str;
    while (getline(cin,str))
    {
         if (str.length() > 0)
         {
             // process input
         }
    }
    return 0;
}
This will read until end of file and skips blank lines as well. Hope this helps.
by chunyi81
Thu Jun 28, 2007 5:39 pm
Forum: Volume 1 (100-199)
Topic: 122 - Trees on the level
Replies: 103
Views: 9656

Check this line: level[i-1].member.insert(make_pair(test," ")); It's the only place which has a 2-character string array. You are assigning a " " (taken to be a const string) to a non-const string. Try something like the following: string space(" "); level[i-1].member.insert(make_pair(test,space));
by chunyi81
Sat Jun 23, 2007 12:34 pm
Forum: C++
Topic: why is it not working? help from any geek?
Replies: 2
Views: 2156

Use operator[]. STL vector's at() is not supported in this OJ

This question has been asked many times before. Search before you post.
by chunyi81
Sun Jun 10, 2007 4:58 pm
Forum: C
Topic: Complie error
Replies: 4
Views: 5578

One possible reason could be the use of C++ style comments in C code -

Code: Select all

// comment
Usually, this should compile with gcc but the judge's version of gcc won't compile this.
by chunyi81
Tue Jun 05, 2007 5:06 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176837

Code: Select all

while (cin >> a >> b)
{
    // process input
}
will work as well.
by chunyi81
Thu Apr 26, 2007 5:37 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 76779

My AC program has a slightly different output than the one above. My AC program outputs: Jolly Not jolly Not jolly Jolly Jolly Not jolly Jolly Jolly Jolly Not jolly Not jolly Jolly Jolly Not jolly Jolly Not jolly Jolly As for which one is correct, it all comes down to the following input: 1 2 Since ...
by chunyi81
Sun Jan 07, 2007 10:28 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 20663

Ok, I am certain there are extra blank lines at the end of judge input, but not in the middle, as mogers's sample input suggests. Can anyone verify this? Thanks.
by chunyi81
Sun Jan 07, 2007 10:24 am
Forum: Bugs and suggestions
Topic: 444 - Encoder and Decoder - PE Issue
Replies: 4
Views: 2533

I added in checking for blank lines. And there are blank lines in the judge input. The blank lines occur right at the end of the judge input based on my current AC code which checks for blank lines. I am certain there are no blank lines in the middle of the judge input or my code would have gotten a...
by chunyi81
Sun Jan 07, 2007 4:59 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 20663

Thanks for the input. My PE code up there crashes for blank lines. But it should have been a WA rather than PE if there had been blank lines in the input?

Go to advanced search