Search found 1 match

by imifeng
Fri Sep 03, 2010 1:53 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320466

100 The 3n + 1 problem Time limit exceeded

Here is my code:

How to change it?

#include <stdio.h>

void cycle(int a);
int cl;

int main(void)
{
unsigned int i, j, max;
int k, Up, Lower;
extern int cl;

while (scanf("%d %d", &i, &j))
{
max = 0;
Up = i > j ? i : j;
Lower = i < j ? i : j;

for ( k = Lower; k <= Up; k++ )
{
cl = 0 ...

Go to advanced search