Search found 5 matches
- Mon Jul 26, 2004 1:14 am
- Forum: Volume 3 (300-399)
- Topic: 307 - Sticks
- Replies: 56
- Views: 27219
307 - WA been greedy
I changed the code posted earlier(that one gave me TLE), to a Greedy aproach in which I sort the sticks sizes first and then search in all possible lenghts of the original sticks, beginning from the minimun length possible to the max posible which is the sum of all sticks' length. I think is the ...
- Fri Jul 23, 2004 8:21 pm
- Forum: Volume 4 (400-499)
- Topic: 492 - Pig-Latin
- Replies: 213
- Views: 49529
now i get WA ????
thanks Wr, changed the code, looks like this:
[c]#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int esVocal(char l) {
l = toupper(l);
if(l=='A' || l=='E' || l=='I' || l=='O' || l=='U')
return 1;
else
return 0;
}
int main() {
char pendiente;
char start;
char cons;
char ...
[c]#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int esVocal(char l) {
l = toupper(l);
if(l=='A' || l=='E' || l=='I' || l=='O' || l=='U')
return 1;
else
return 0;
}
int main() {
char pendiente;
char start;
char cons;
char ...
- Thu Jul 22, 2004 11:26 pm
- Forum: Volume 4 (400-499)
- Topic: 492 - Pig-Latin
- Replies: 213
- Views: 49529
492 runtime error, why??
I get Runtime Error from the judge(SIGSEV-Invalid memory reference) can't see why
Here is my code:
[c]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int esVocal(char l) {
l = toupper(l);
if(l=='A' || l=='E' || l=='I' || l=='O' || l=='U')
return 1;
else
return ...
Here is my code:
[c]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int esVocal(char l) {
l = toupper(l);
if(l=='A' || l=='E' || l=='I' || l=='O' || l=='U')
return 1;
else
return ...
- Thu Jul 22, 2004 5:47 am
- Forum: Volume 7 (700-799)
- Topic: 750 - 8 Queens Chess Problem
- Replies: 78
- Views: 39161
750 something wrong in my code?
I can't figure out what's wrong with my program:
on the input:
1
1 1
Note the first number is the number of cases(since is a multiple input problem as stated in the problemset)
i yields:
SOLN COLUMN
# 1 2 3 4 5 6 7 8
1 1 5 8 6 3 7 1 4 /*Here is the problem*/
2 1 6 8 3 7 4 2 5
3 1 7 4 6 8 ...
on the input:
1
1 1
Note the first number is the number of cases(since is a multiple input problem as stated in the problemset)
i yields:
SOLN COLUMN
# 1 2 3 4 5 6 7 8
1 1 5 8 6 3 7 1 4 /*Here is the problem*/
2 1 6 8 3 7 4 2 5
3 1 7 4 6 8 ...
- Tue Jul 20, 2004 7:11 pm
- Forum: Volume 3 (300-399)
- Topic: 307 - Sticks
- Replies: 56
- Views: 27219
307(Sticks) TLE why??
I get TLE for this problem: why?
total time 10.0something secs, limit 10 secs.
Here is the code:
[c]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int solucion;
int failed;
int lenghtSol;
int *usado;
int *stickSize;
int allUsed(int *usado,int N) {
int i;
for(i=0;i<N && usado ==1;i ...
total time 10.0something secs, limit 10 secs.
Here is the code:
[c]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int solucion;
int failed;
int lenghtSol;
int *usado;
int *stickSize;
int allUsed(int *usado,int N) {
int i;
for(i=0;i<N && usado ==1;i ...