Search found 3 matches

by mustak0715
Sat Oct 30, 2010 8:44 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 20457

problem 136

is this correct the 1500th ugly number is 2999. please say me anyone. here is code where is error; #include<stdio.h> #include<iostream> #include<vector> using namespace std; vector<long>ugly; vector<long>list; vector<long>::iterator it; vector<long>::iterator u; void primegenerate(long n) { //list.p...
by mustak0715
Tue Oct 26, 2010 6:41 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 22230

490 when input stops???

when will be the input stops? tell me. my code.... #include<stdio.h> #include<iostream> using namespace std; int main() { char a[100][100]; int max=0; int flagnull[100]; int i=0; while(gets(a )) { if(a [strlen(a )-1]==9) { if(strlen(a )<=1) break; a [strlen(a )-1]='\0'; i++; break; } i++; } max=i; i...
by mustak0715
Tue Oct 26, 2010 4:12 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193492

time limit exceeded!

WHY TIME LIMIT EXCEEDED!!!!! PLEASE HELP! #include<iostream> #include<stdio.h> int counter; using namespace std; int retcounter(long n) { counter=1; while(n!=1) { counter++; if(n%2==0) n=n/2; else n=3*n+1; } return counter; } int main() { unsigned long start,end,n,temp; int max=1; while(cin>>start>>...

Go to advanced search