Search found 8 matches

by hts
Sun May 01, 2005 6:51 pm
Forum: Volume 108 (10800-10899)
Topic: 10801 - Lift Hopping
Replies: 56
Views: 37214

I got ACC :D

It was a silly bug, this testcase helped me

Code: Select all

2 5
1 1
0 3
4 5
the above input reading routine is right.
by hts
Sun May 01, 2005 9:27 am
Forum: Volume 108 (10800-10899)
Topic: 10801 - Lift Hopping
Replies: 56
Views: 37214


gets(buf);

p = buf;
while(*p != '\n' && *p != 0)
{
while(*p == ' ' || *p == 0)
p++;

if(*p == '\n' || *p == 0)
break;

j = atoi(p);

while(*p != ' ' && *p != '\n')
p++;

acesso[i][j] = 1;
}


and also


gets(buf);
p = buf;
while(*p != '\n' && *p != 0)
{
sscanf(p, "%d%n", &j, &u ...
by hts
Sun May 01, 2005 8:38 am
Forum: Volume 108 (10800-10899)
Topic: 10801 - Lift Hopping
Replies: 56
Views: 37214

About I/O

It is really anoying to read this kind of input in C, I did this:

Code: Select all

c = 0;
while(c != '\n' && scanf("%d%c", &j, &c) == 2)
	acesso[i][j] = 1;
acesso[i][j] = 1; 
But I got WA, I used Dijkstra as well... I think there are spaces left after the last number in each line.
by hts
Thu Apr 10, 2003 3:22 am
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 15962

Implemented pi = 2*acos(0) and double... but W.A. again :( :( :( :( :( :( :cry: :cry:
by hts
Tue Apr 08, 2003 4:46 am
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 15962

10209: Is this integration? WA!!@@#!

http://acm.uva.es/p/v102/10209.html

I derived the area of the regions the problem asked, then I implemented it on my solution.
It worked well with all tests cases, by I only got WA :/

Can anyone help-me on this?



#include <stdio.h>

#define PI 3.1415926535897932384626433832795
#define SQUARE_3 ...
by hts
Sun Mar 02, 2003 4:22 am
Forum: Volume 1 (100-199)
Topic: 156 - Ananagrams
Replies: 30
Views: 7075

Compile Error ?!?!? (Problem 156)

I got Compile Error, but I didn't received any e-mail telling me what went wrong. :(


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int assinaturas[1000];
char words[1000][20];
int N;
FILE *fin = stdin;

int cmp(const char *str1, const char *str2)
{
return strcmp(str1, str2);
}

int ...
by hts
Sat Mar 01, 2003 3:59 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 32293

Re: Test cases for 112 (Tree Summing)?

I found the problem on my solution.
It wasn't processing correctly negative numbers

A little modification made my solution be accepted :)

c == '-'


int aceitavel(char c)
{
if(c == '(' || c == ')' || c == '-')
return 1;
else
if(c <= '9' && c >= '0')
return 1;
else
return 0;
}
by hts
Sat Feb 22, 2003 3:02 am
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 32293

Test cases for 112 (Tree Summing)?

I made a solution here, but I got WA for problem 112.
http://acm.uva.es/p/v1/112.html

Can anybody help me on this?


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

FILE *fin = stdin;
int L, limite;
char string[20000];
int index;

int aceitavel(char c)
{
if(c == '(' || c ...

Go to advanced search