Search found 4 matches

by nut
Mon Jan 22, 2007 1:03 pm
Forum: Volume 111 (11100-11199)
Topic: 11155 - Be Efficient
Replies: 15
Views: 13204

why WA?

It seems right but I can't find the bug. :-(



#include <iostream>

#define MAXN 10000

using namespace std;

long long t, cc, a, b, c, m, n, i, r, res;
long long x[MAXN];
long long s[MAXN];
long long mod[MAXN];


int main()
{
cin >> t;
for (cc=0; cc<t; cc++)
{
cin >> a >> b >> c >> m >> n;
x ...
by nut
Sun Nov 12, 2006 12:34 pm
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 55311

now WA

I fixed some things, and now I get WA not MLE, now the code looks like this:

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

#define N 1000
#define LONG_MAX 2147483647
#define MAX 10

class Queue
{
public:
int x,y;
Queue *next;
Queue *prev;
Queue *last;
Queue *first;
int numel;
public:
Queue ...
by nut
Sun Nov 12, 2006 12:07 pm
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 55311

Even though you got a way out of MLE, i think you'll get TLE.
I tried your code with STL Queue, and got TLE. This is the code.

In your code, same places could be expanded (queued) several times.
And it is determing min-distance for all the places.


Actually, a used 10 queues in order to not ...
by nut
Sat Nov 11, 2006 7:38 pm
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 55311

ok, let's discuss it here

Actually, thanks for your help. I just didn't cheked up and left (oops), but it didn't affect to MLE.

Now it looks lile:


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

#define N 1000
#define LONG_MAX 2147483647
#define MAX 10

class Queue
{
public:
int x,y;
Queue *next;
Queue *prev;
Queue *last ...

Go to advanced search