Search found 4 matches

by Kevin Waugh
Tue Feb 10, 2004 1:24 am
Forum: Volume 7 (700-799)
Topic: 729 - The Hamming Distance Problem
Replies: 54
Views: 21459

Fixed it .. Thanks :)
by Kevin Waugh
Tue Feb 10, 2004 12:22 am
Forum: Volume 7 (700-799)
Topic: 729 - The Hamming Distance Problem
Replies: 54
Views: 21459

I get output limit exceeded as well, I'm not sure why. I handle multiple input, and it seems to output the right output in the case N = 16, H = 8.

[cpp]
#include <cstdio>
#include <vector>

using namespace std;

//int cnt = 0;

void doit(int l, int h, vector<char>& start) {
if (l == 0) {
for(int ...
by Kevin Waugh
Mon Feb 02, 2004 1:27 am
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 56720

The following code wrong answers on 10000:

[cpp]
#include <cstdio>
#include <queue>
#include <utility>
#include <map>
#include <list>

using namespace std;

int main() {
int n;
int c = 1;
while (scanf(" %d", &n) == 1 && n) {
map<int, list<int> > edge;
bool visit[101] = {false};
int s;
scanf ...
by Kevin Waugh
Sun Feb 01, 2004 12:55 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 56720

The problem statement claims that the graph has no cycles, but my BFS times out unless I check that I only visit each node once. When I do the check, my program WAs.

When I searched the forums there's a post under the Fix Forum that the dataset for this problem was increase. It seems as if this new ...

Go to advanced search