Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7691371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:36:28+00:00 2026-05-31T20:36:28+00:00

I am submitting my code for Euler10 puzzle at Gild.com in Java using its

  • 0

I am submitting my code for Euler10 puzzle at Gild.com in Java using its online editor. The code runs perfectly for all test cases on my PC but compilation on Gild fails. I am following all of its coding rules but I think I’m still missing something.
Here’s my code:

class Euler10 {

public static void main(String[] args) throws java.lang.Exception
{
    java.io.BufferedReader br = new java.io.BufferedReader (new java.io.FileReader(args[0]));
    int number = Integer.parseInt(br.readLine());
    boolean[] isPrime = new boolean[number + 1];
    for (int i = 2; i <= number; i++)
        isPrime[i] = true;
    for (int i = 2; i*i <= number; i++)
    {
        if (isPrime[i])
        {
            for (int j = i; i*j <= number; j++)
                isPrime[i*j] = false;
        }
    }
    long primesum = 0;
    for (int i = 2; i < number; i++)
    {
       if (isPrime[i])
          primesum = primesum+i;
    }
    System.out.println(""+primesum+"\n");
}

}

After compiling this code in debug mode, I get the following error:


My program output shown above is same as the test case output even though it gives wrong result.
Also tell me what is a Diff Output in this context.

(I want to submit the code in the online editor only.)

Gild coding Puzzle FAQs &
Submission guidelines

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:36:29+00:00Added an answer on May 31, 2026 at 8:36 pm

    It seems that the problem is that your output is not identical to the expected output. Try replacing your last line System.out.println(""+primesum+"\n"); with (System.out.println(""+primesum);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following code. Which is submitting fine with php and it
I am using this zip code verification script I found online but instead of
I am having issues with session in my java code. Upon submitting a form
The pasted below code i am using to create dropdown list and java script
I'm submitting a form using an ajax request (POST method), and checking the HTTP
When submitting SAS code via the SAS Toolbar (eg cmjohns response ) the compiler
I was submitting a matrix exponentiation code in C language for finding the nth
I'm using the following code (via ' Dark Side of the Carton ') to
I am using this code to try and submit a value via form but
I am using Uploadify and am having problems submitting a form to uploaded1.php after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.