Search found 15 matches

by czar
Sat Mar 19, 2005 8:54 pm
Forum: Volume 100 (10000-10099)
Topic: 10088 - Trees on My Island
Replies: 11
Views: 6046

I have been staring at my code for awhile and I am not sure what is wrong with it. I could use a fresh set(s) of eyes, in finding the error (it is probably a very stupid error) in my code.... or better yet just give me some data that breaks my code. Thanks in advance.


#include<iostream>
#include ...
by czar
Mon Jul 05, 2004 6:22 pm
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 31690

10278 fire stations runtime error

I am getting a runtime error and I have no idea why....

[cpp]#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<numeric>

using namespace std;

typedef vector<vector<int> > VVI;
typedef vector<int> VI;

int nis,nfs;

typedef struct Cell Cell;
struct ...
by czar
Thu Dec 18, 2003 12:43 am
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 37296

10003 Cutting Sticks

I was wondering if anyone had any suggestions on speeding this program up keeping the top down structure of the solution (It gets accepted but takes 9 secs on the test cases).

[cpp]
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

typedef vector<int ...
by czar
Sat Dec 06, 2003 10:16 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 56492

I was wondering if anyone could tell me what is wrong with my code or if I am even using the right algorithm.

I just topological sort the vertices.

[cpp]
#include<iostream>
#include<vector>
#include<cmath>
#include<queue>

using namespace std;

vector<vector<int> > g;
vector<int> indeg;
int maxl ...
by czar
Tue Dec 02, 2003 5:16 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116567

102-Ecological Bin Packing - compile error

could anyone tell me why I keep on receiving a compile error. The code compiles under the most recent mingw g++.

[cpp]
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<utility>
#include<cstdio>

using namespace std;

typedef vector<int> VI; typedef ...
by czar
Sun Sep 07, 2003 9:29 pm
Forum: Volume 100 (10000-10099)
Topic: 10044 - Erdos Numbers
Replies: 102
Views: 55231

10044

Can anyone tell me what is wrong with my code?

[c]#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<iterator>
#include<algorithm>
#include<string>
#include<cstdio>

using namespace std;

string DEGREE0("Erdos, P.");
const int INITDEGREE = -1;

void split ...
by czar
Fri Sep 05, 2003 11:59 pm
Forum: Volume 102 (10200-10299)
Topic: 10205 - Stack 'em Up
Replies: 60
Views: 33155

Thanks Daniel.
by czar
Wed Sep 03, 2003 2:10 am
Forum: Volume 102 (10200-10299)
Topic: 10205 - Stack 'em Up
Replies: 60
Views: 33155

10205

Could someone please tell me why this won't compile?
note: It compiles fine under the version of gcc that comes with latest stable version mingw.

[cpp]
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;

const int NUMCARDS = 52;

char suits[][10 ...
by czar
Tue Jun 24, 2003 7:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 42025

Nevermind, I found the problem
by czar
Tue Jun 24, 2003 6:59 pm
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 42025

Nevermind, I found the problem
by czar
Tue Jun 24, 2003 4:46 am
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 42025

yes that works. I originally had

[c]while(scanf("%i", &factorial) == 1) {
//Do stuff
}[/c]

but still got the same output limit exceeded error. I still have no clue as to why I am getting an output limited exceeded error.
by czar
Mon Jun 23, 2003 10:04 pm
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 42025

10139

why am I getting an output limit exceeded error?

[c]#include<stdio.h>
#include<math.h>

#define UPPER_BOUND 66000
#define MAX_PRIME_FACTORS 20

int init(int *primes) {
unsigned long a[UPPER_BOUND];
unsigned long i = 0, j = 0;

for(i = 0; i < UPPER_BOUND; i++) a = 1;

for(i = 2; i < UPPER_BOUND ...
by czar
Fri Jun 20, 2003 8:05 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101751

I got rid of the endl's and then everything was fine.
by czar
Thu Jun 12, 2003 1:48 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101751

10035

Can someone tell to me what is wrong with this code?

[cpp]
int count_carries(unsigned long a, unsigned long b) {
int carry = 0;
int digita = 0;
int digitb = 0;
int counter = 0;

while(a != 0 || b!=0) {
digita = a % 10;
digitb = b % 10;

a = a/10;
b = b/10;

if(digita + digitb + carry > 9 ...
by czar
Tue Jun 10, 2003 7:34 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101751

any ideas what is wrong with this

[cpp]
#include<iostream>
using namespace std;

int count_carries(unsigned long a, unsigned long b) {
int carry = 0;
int digita = 0;
int digitb = 0;
int counter = 0;

while(a != 0 || b!=0) {
digita = a % 10;
digitb = b % 10;

a = a/10;
b = b/10;

if(digita + digitb + carry > 9) {
carry ...

Go to advanced search