Search found 9 matches

by Miguel Correia Ricardo
Sat May 08, 2004 6:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10267 - Graphical Editor
Replies: 190
Views: 77222

10267 Graphical Editor WA Why Please...

I'm getting wrong answer and i don't know why, i would appreciate some kind of help. Thank you.


[c]
#include <stdio.h>

#define MAX 10000 /* max depth of stack */

typedef struct {short y, xl, xr, dy;} Segment;
/*
* Filled horizontal segment of scanline y for xl<=x<=xr.
* Parent segment was on ...
by Miguel Correia Ricardo
Sat May 08, 2004 6:38 pm
Forum: Volume 102 (10200-10299)
Topic: 10267 - Graphical Editor
Replies: 190
Views: 77222

10267 Graphical Editor WA Why Please...

I'm getting wrong answer and i don't know why, i would appreciate some kind of help. Thank you.


[c]
#include <stdio.h>

#define MAX 10000 /* max depth of stack */

typedef struct {short y, xl, xr, dy;} Segment;
/*
* Filled horizontal segment of scanline y for xl<=x<=xr.
* Parent segment was on ...
by Miguel Correia Ricardo
Thu Aug 28, 2003 1:30 am
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 73341

I've donne some corrections

Hi, i've donne some corrections, but still it gives me WA, but why...

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

using namespace std;

int main(){
string a;
string b;
string result;

cin.setf(ios::skipws);

while(cin >> a >> b){
result.resize(1000 ...
by Miguel Correia Ricardo
Wed Aug 27, 2003 6:50 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 73341

10252 WA WHY?!

What's wrong with my code?
It passes all the test i've seen in the bulletin board...

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

using namespace std;

void permutation(string& a, string& b, string& result){
for (unsigned int i = 0; i < a.length(); i++)
if ((b.find(a ...
by Miguel Correia Ricardo
Fri Mar 14, 2003 2:40 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108740

I got Acepted

Here is the code correct and much more simplified than the previous one:
[cpp]
#include <iostream>
#include <string>
#include <vector>

using namespace std;

class Index{
unsigned int x;
unsigned int y;
public:
Index (){}
Index(unsigned int x, unsigned int y):
x(x),
y(y)
{
}

Index(const ...
by Miguel Correia Ricardo
Fri Mar 14, 2003 2:00 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108740

OK REWRITTEN CODE....!!! Still Have the same PROBLEM!

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

using namespace std;

class Index{
unsigned int x;
unsigned int y;
public:
Index (){}
Index(unsigned int x, unsigned int y):
x(x),
y(y)
{
}

Index(const Index& idx) {
Set(idx.X(),idx.Y());
}

void Set (unsigned int xPoint ...
by Miguel Correia Ricardo
Thu Mar 13, 2003 11:53 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108740

101 SIGSEV and WORKS WITH ALL EXAMPLES!

Hi, Judge replies to my solution SIGSEV? Why, is anything wrong with the Vectors?
[cpp]
#include <iostream>
#include <string>
#include <vector>

using namespace std;

class Index{
unsigned int x;
unsigned int y;
public:
Index (){}
Index(unsigned int x, unsigned int y):
x(x),
y(y)
{
}

Index ...
by Miguel Correia Ricardo
Sat Nov 30, 2002 4:24 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

Of a forgot one thing...

I forgot to do temp = 0, outside the if scope...but it still gives wrong answer....
by Miguel Correia Ricardo
Sat Nov 30, 2002 4:11 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

What's wrong with my code...

Hi, what's wrong with my code, it gives WRONG ANSWER...

#include <iostream>
#include <algorithm>
using namespace std;

int cycle_length (unsigned int i)
{
unsigned int max=1;

while (i > 1)
{
if (i % 2)
i = 3*i + 1;
else
i /= 2;

max++;
}
return max;
}

int main()
{
unsigned int i,j ...

Go to advanced search