why do I get Runtime error in problem 673? Please help.
[cpp]#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
char b[129];
void init(){
for(int i=0;i<129;i++)
b ='\0';
}
class stack{
public:
int index;
stack(){index=0;}
int data[129];
void push(int n){data ...
Search found 6 matches
- Fri Nov 07, 2003 5:02 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 79453
- Thu Sep 11, 2003 3:52 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 116808
AC
the problem was in the less function, i used strcmp instead and got AC.
thnx,
Joe
thnx,
Joe
- Sun Aug 24, 2003 4:04 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 116808
it still did not work
hi,
I tried to change all int's to long but still I got WA
here is my code.
[cpp]#include <iostream.h>
#include <math.h>
struct Bin{
long brown;
long green;
long clear;
};
Bin bin[3];
inline long Calculate_Cost(char a[]);
inline bool less(char a[], char r[]);
void Perm(char a[], int k, int n ...
I tried to change all int's to long but still I got WA
here is my code.
[cpp]#include <iostream.h>
#include <math.h>
struct Bin{
long brown;
long green;
long clear;
};
Bin bin[3];
inline long Calculate_Cost(char a[]);
inline bool less(char a[], char r[]);
void Perm(char a[], int k, int n ...
- Fri Aug 15, 2003 11:34 am
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 116808
why WA in the ecological bin problem (102)
my code worked for the sample input that was in the problem, but when I submitted it, i received a WA. Somebody Please help!
here is my code:
[cpp]#include <iostream.h>
struct Bin{
int brown;
int green;
int clear;
};
Bin bin[3];
inline int Calculate_Cost(char a[]);
inline bool less(char a ...
here is my code:
[cpp]#include <iostream.h>
struct Bin{
int brown;
int green;
int clear;
};
Bin bin[3];
inline int Calculate_Cost(char a[]);
inline bool less(char a ...
- Fri Aug 08, 2003 8:10 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
thnx
I got correct answer, thank you xbeanx 

- Fri Aug 08, 2003 7:29 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
Time limit exceeded in problem 100
hi,
would anybody please tell me why do I get Time limit exceeded for the 3n+1 problem. here is my code:
[cpp]#include <iostream.h>
#include <fstream.h>
ifstream in;
void main(){
in.open("in.txt");
int i,j;
long max;
long x,y;
while(!in.eof())
{
in>>x>>y;
cout<<x<<' '<<y<<' ';
if (x>y ...
would anybody please tell me why do I get Time limit exceeded for the 3n+1 problem. here is my code:
[cpp]#include <iostream.h>
#include <fstream.h>
ifstream in;
void main(){
in.open("in.txt");
int i,j;
long max;
long x,y;
while(!in.eof())
{
in>>x>>y;
cout<<x<<' '<<y<<' ';
if (x>y ...