Search found 4 matches

by sum_sim
Wed Nov 30, 2011 4:28 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 77357

10055 Getting TLE

Can anyone tell me what is wrong with the code? I've tried several time but getting TLE.

hasNext();
hasNextLong()
none of them are working. Please help.

import java.util.*;
import java.io.*;

public class Main {

public static void main(String args[]){
long a, b, c;
Scanner cin = new ...
by sum_sim
Wed Nov 30, 2011 4:25 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 77357

10055 Getting TLE

Can anyone tell me what is wrong with the code? I've tried several times but I'm getting TLE. Please help.

import java.util.*;
import java.io.*;

public class Main {

public static void main(String args[]){
long a, b, c;
Scanner cin = new Scanner(new BufferedReader(new InputStreamReader(System ...
by sum_sim
Thu Jun 17, 2010 9:46 pm
Forum: Volume 109 (10900-10999)
Topic: 10924 - Prime Words
Replies: 44
Views: 29726

Re: 10924 - Prime Words

I got AC....1 should take as a prime number here...:)
by sum_sim
Thu Jun 17, 2010 8:35 pm
Forum: Volume 109 (10900-10999)
Topic: 10924 - Prime Words
Replies: 44
Views: 29726

Re: 10924 - Prime Words

Hey plz help me...um getting WA...here is my code...please check it..

#include<iostream>
using namespace std;
int j;
bool prime_check(int p)
{
if(p == 1) return false;
else if(p == 2) return true;
else if(p%2==0) return false;
else if( p > 2)
for(j=3; j*j<=p; j += 2)
if( p%j == 0){ return ...

Go to advanced search