i m getting time limit exceed . plz help me i dont know y
[cpp]
#include<stdio.h>
bool checkprime(int num)
{
int flag=0;
if(num==2)
{
return true;
}
else
{
int count=2;
while(count<=(num/2)+1)
{
flag = 0;
if((num%count)==0)
{
flag=1;
break;
}
count=count+1;
}
if(flag ...
Search found 5 matches
- Sun Jul 04, 2004 1:53 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10533 - Digit Primes
- Replies: 108
- Views: 47727
- Mon Jun 28, 2004 8:06 pm
- Forum: Volume 2 (200-299)
- Topic: 202 - Repeating Decimals
- Replies: 82
- Views: 25414
Then plz tell me wht is the breaking condition
shamim wrote:jahangirk:
There is no breaking condition in your program, to cause it to terminate. It expects to take input forever. For this reason it is getting TLE.
- Mon Jun 28, 2004 11:40 am
- Forum: Volume 2 (200-299)
- Topic: 202 - Repeating Decimals
- Replies: 82
- Views: 25414
i think my program result is correct on ur intputs as well.
helmet wrote:I dunno why ur code is TLE but I can tell u why it will be WA anyways.
Try input of
3 4
99 99
99 100
I dont quite think the desired result is got.
I didnt read ur algo so I dunno about TLE...
- Mon Jun 28, 2004 9:14 am
- Forum: Volume 2 (200-299)
- Topic: 202 - Repeating Decimals
- Replies: 82
- Views: 25414
202 Repeating decimal. Why TLE somebody help me plzz
I am getting Time limit exceed. To me i have created an efficient algo and it is giving me correct answer if anybody have better logic than mine plz help me
[cpp]#include <stdio.h>
#include<iostream>
using namespace std;
int Z[100000];
int num, den;
int i=0;
void init();
int main ...
[cpp]#include <stdio.h>
#include<iostream>
using namespace std;
int Z[100000];
int num, den;
int i=0;
void init();
int main ...
- Sat Jun 26, 2004 11:30 pm
- Forum: Volume 4 (400-499)
- Topic: 486 - English-Number Translator
- Replies: 29
- Views: 12689
486. English Number Translator. WHy runtime error ? plz help
I have tested my problem with every possible input but still it is giving my runtime error . i dont know how to correct it . i have also tested this problem on gnu complier. plz help
[cpp]#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
string a[]={"zero", "one ...
[cpp]#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
string a[]={"zero", "one ...