Search found 7 matches

by vladrac
Sun Sep 26, 2004 6:26 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 37025

thankx epsilon for the explanation

iT was quite easy to get AC with this understaning of the inputs!
by vladrac
Wed Sep 22, 2004 5:53 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317849

I got it

Dont bother I got it!
by vladrac
Wed Sep 22, 2004 5:51 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317849

thanks everyone

I got AC ,even though with lots of CPU and MEM use.

[cpp]
#include "stdio.h"
int main(void)
{
int i,j,k,max=1,m2=1;

while(scanf("%d %d",&i,&j)==2) {
printf("%d %d ",i,j);
if(i>j){
i ^= j;
j ^= i;
i ^= j;
}
k=j;
while(k>=i)
{
if (k!=1){
j=k;
while (j!=1){
if (j % 2 !=0){
j=(3*j)+1;
}
else{
j/=2 ...
by vladrac
Wed Sep 22, 2004 5:48 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51683

108 works but takes too long! anyhelp

This code works! But takes too long!

Any suggestions Plz!

[cpp]
#include <stdio.h>
#include <malloc.h>


int n=1,ROWS,COLS;
int **array;
int sum_line(int **array1,int *ind,int *ii,int *jj);

int main(void){
int i,j,n,x,y,xi,xj,ni,nj,sum=0,sumq=0,sumtotal=0,val;

sumtotal=0;
scanf("%d",&n ...
by vladrac
Tue Sep 21, 2004 8:07 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317849

plz, some1!

what does "OutPut Limit Exceeded" means?


#include "stdio.h"
int main(void)
{
unsigned long i,j,k,max=1,m2=1;

while(scanf("%lu %lu",&i,&j)!=0) {
printf("%u %u ",i,j);
if(i>j){
i ^= j;
j ^= i;
i ^= j;
}
k=j;
while(k>=i)
{
if (k!=1){
j=k;
while (j!=1){
if (j % 2 !=0){
j=(3*j)+1;
}
else ...
by vladrac
Mon Sep 20, 2004 6:19 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317849

Output Limit Exceeded? what does it means?

the code is this:
#include "iostream.h"
#include "stdio.h"
int main(void)
{
unsigned long i,j,k,max=1,m2=1;

while(scanf("%lu %lu",&i,&j)!=0) {
cout<<i<<" "<<j<<" ";
if(i>j){
i ^= j;
j ^= i;
i ^= j;
}
k=j;
while(k>=i)
{
if (k!=1){
j=k;
while (j!=1){
if (j % 2 !=0){
j=(3*j)+1;
}
else ...
by vladrac
Mon Sep 20, 2004 1:23 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317849

I read every thing about the 100 problem, but still WA, help

Please, somebody, whats wrong with this code?

#include "stdio.h"


int main(void)
{
unsigned long i,j,k,max=1,m2=1;

while(scanf("%lu %lu", &i,&j)!=EOF) {
if(i>j){
i ^= j;
j ^= i;
i ^= j;
printf("%lu %lu ",j,i);
}
else {
printf("%lu %lu ",i,j);
}
k=j;
while(k>=i)
{
if (k!=1){
j=k ...

Go to advanced search