Search found 8 matches

by ttwu
Wed Jun 18, 2003 2:30 pm
Forum: Volume 104 (10400-10499)
Topic: 10400 - Game Show Math
Replies: 32
Views: 23197

I've tried to keep track of the value, but got Runtime Error.. :(
but I don't have any idea why?? can someone help? Thanks! :)

[cpp]
#include<stdio.h>
#define NUMS 102
#define NUMS2 64001
int p,found[NUMS],num[NUMS],target,foundans;
char used[NUMS][NUMS2];
void dig(int n,int res)
{
int i;
if ...
by ttwu
Sun Jun 15, 2003 5:59 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 49424

I have problems with this problem too..
I've made the array size 1000000, but I still keep getting RTE..
I just dont know why? :(

[cpp]
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void main()
{
char str[1000000],p[1000000],a;
int lena,lenp,i,j;

while(gets(str))
{
lena=strlen(str ...
by ttwu
Tue Jun 03, 2003 5:48 pm
Forum: Volume 5 (500-599)
Topic: 598 - Bundling Newspapers
Replies: 25
Views: 12045

598 - Bundling Newspapers

This is my code, but I don't know why I get Runtime Error(SIGSEGV) :(
Can someone help me? Thanks!
[cpp]
#include<stdio.h>
#include<string.h>
int used[14],found[14],totalnum=0,k;
char name[14][35];

void dig(int n)
{
int i;
if (n==k+1)
{
printf("%s",name[found[1]]);
for (i=2;i<=k;i++) printf ...
by ttwu
Sun Jun 01, 2003 7:15 am
Forum: Volume 102 (10200-10299)
Topic: 10285 - Longest Run on a Snowboard
Replies: 10
Views: 9312

I changed my code like this and got accepted..but I really have no idea what the difference is. :o
Can somebody explain why? Thanks!
[cpp]
#include<stdio.h>
int a[101][101],R,C,max1,max2;

void dig(int i,int j,int len)
{
if (len>max1) max1=len;

if (i-1>=0 && a[i-1][j]<a [j]) dig (i-1,j,len+1 ...
by ttwu
Fri May 30, 2003 7:02 pm
Forum: Volume 102 (10200-10299)
Topic: 10285 - Longest Run on a Snowboard
Replies: 10
Views: 9312

10285 - Longest Run on a Snowboard

I don't know why I get Wrong Answer with Q10285.. :(
Can someone tell me where I am wrong, or is there more test cases? Thx!

[cpp]
#include<stdio.h>
int a[101][101],R,C,max,len;

void dig(int i,int j)
{
len++;
if (len>max) max=len;

if (i-1>=0 && a[i-1][j]<a [j]) { dig (i-1,j); len--; } // Up ...
by ttwu
Sat May 24, 2003 4:47 pm
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 21937

I made some changes to the code and got accepted :)
It was the negative problem. Thanks very much! :D
by ttwu
Sat May 24, 2003 7:21 am
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 21937

694 - The Collatz Sequence

I got output limit exceeded but I don't know why.. :(
please help me..Thanks!

[cpp]
#include<stdio.h>
void main()
{
unsigned long i,j;
int clen,setnum=1;

while(1)
{
scanf("%ld %ld",&i,&j);
if (i<0 && j<0) break;

printf("Case %d: A = %ld, limit = %ld, number of terms = ",setnum,i,j);

for ...
by ttwu
Tue May 13, 2003 4:43 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 22448

Maybe you've forgotten a call that lasts for exactly 24hr?

Go to advanced search